aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-03 22:50:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-11-28 20:27:41 +0100
commit7128f67c3f2024b2fd6eb6ad80ea212f855a7929 (patch)
tree0ca3d66403ef775de54c8285a24388fd9192ab1a
parenteac21ee7ba0f9a29f96a0abd219f00075cbd30d7 (diff)
downloadffmpeg-7128f67c3f2024b2fd6eb6ad80ea212f855a7929.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> (cherry picked from commit c727401aa9d62335e89d118a5b4e202edf39d905) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/smc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/smc.c b/libavcodec/smc.c
index d0102eaa9c..c640fb2195 100644
--- a/libavcodec/smc.c
+++ b/libavcodec/smc.c
@@ -69,7 +69,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; \