aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-03 22:50:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-03 22:51:29 +0200
commitc727401aa9d62335e89d118a5b4e202edf39d905 (patch)
tree21cad9904086d14211a530f471566c7f4df260c0 /libavcodec
parent883bc7d2e7c7e6ba6710b0d5c41e5a584297f66c (diff)
downloadffmpeg-c727401aa9d62335e89d118a5b4e202edf39d905.tar.gz
avcodec/smc: fix off by 1 error
Fixes out of array access Fixes: asan_heap-oob_1685bf0_5_asan_heap-oob_1f35116_430_smc.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/smc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/smc.c b/libavcodec/smc.c
index 4bfa4a8622..01271b308c 100644
--- a/libavcodec/smc.c
+++ b/libavcodec/smc.c
@@ -70,7 +70,7 @@ typedef struct SmcContext {
row_ptr += stride * 4; \
} \
total_blocks--; \
- if (total_blocks < 0) \
+ if (total_blocks < 0 + !!n_blocks) \
{ \
av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
return; \