[FFmpeg-cvslog] smc: fix the bounds check
Michael Niedermayer
git at videolan.org
Fri Dec 19 13:26:35 CET 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Oct 3 22:50:45 2014 +0200| [d423dd72be451462c6fb1cbbe313bed0194001ab] | committer: Anton Khirnov
smc: fix the bounds check
Fixes invalid writes when there are more blocks in a run than total
remaining blocks.
CC: libav-stable at libav.org
Bug-ID: CVE-2014-8548
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d423dd72be451462c6fb1cbbe313bed0194001ab
---
libavcodec/smc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/smc.c b/libavcodec/smc.c
index 46903ab..c6541da 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 < !!n_blocks) \
{ \
av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
return; \
More information about the ffmpeg-cvslog
mailing list