[FFmpeg-cvslog] xbmdec: fix off by one error in scanf()

Michael Niedermayer git at videolan.org
Tue May 14 01:54:57 CEST 2013


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Sun May  5 00:23:13 2013 +0200| [f072b69f39a3237869d86e507bf354df0d688434] | committer: Michael Niedermayer

xbmdec: fix off by one error in scanf()

Fixes out of array access

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f072b69f39a3237869d86e507bf354df0d688434
---

 libavcodec/xbmdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c
index 626e8de..871704e 100644
--- a/libavcodec/xbmdec.c
+++ b/libavcodec/xbmdec.c
@@ -57,7 +57,7 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data,
         int number, len;
 
         ptr += strcspn(ptr, "#");
-        if (sscanf(ptr, "#define %256s %u", name, &number) != 2) {
+        if (sscanf(ptr, "#define %255s %u", name, &number) != 2) {
             av_log(avctx, AV_LOG_ERROR, "Unexpected preprocessor directive\n");
             return AVERROR_INVALIDDATA;
         }



More information about the ffmpeg-cvslog mailing list