xbmdec: fix off by one error in scanf()
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 4 May 2013 22:23:13 +0000 (00:23 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 13 May 2013 22:50:54 +0000 (00:50 +0200)
Fixes out of array access

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/xbmdec.c

index 626e8de..871704e 100644 (file)
@@ -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;
         }