diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-03 22:50:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-05 14:20:32 +0200 |
commit | b0964918d882dd3ae589f76df01551ca0234d910 (patch) | |
tree | 3d0011ae95f82948137c1abc176da4e14cedf5db | |
parent | d8fda618d01dcafb82b695648e9ae6082f8d69ec (diff) | |
download | ffmpeg-b0964918d882dd3ae589f76df01551ca0234d910.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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/smc.c b/libavcodec/smc.c index 31e6c885bf..791612ebd4 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; \ |