diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-03 22:50:45 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-12-20 11:16:34 +0100 |
commit | a331e11906b196c9a00f5ffbc45d80fcd7fe8423 (patch) | |
tree | 07b20e5d6f987317b6e45dc50b70fcceca58126c /libavcodec/smc.c | |
parent | fc159ba88ea2dd1fa11e4ab6af8b574fc80db454 (diff) | |
download | ffmpeg-a331e11906b196c9a00f5ffbc45d80fcd7fe8423.tar.gz |
smc: fix the bounds check
Fixes invalid writes when there are more blocks in a run than total
remaining blocks.
CC: libav-stable@libav.org
Bug-ID: CVE-2014-8548
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit d423dd72be451462c6fb1cbbe313bed0194001ab)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 58dc526ebf722d33bf09275c1241674e0e6b9ef1)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit f249e9889155599ee3ad0172832d38f68b0c625d)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 306ee95088243fefa2dfcb5c355d439db75e2d2a)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/smc.c')
-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 2bd3176f8e..257d5dae5f 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 < !!n_blocks) \ { \ av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \ return; \ |