Browse code

xbmdec: fix off by one error in scanf()

Fixes out of array access

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

Michael Niedermayer authored on 2013/05/05 07:23:13
Showing 1 changed files
... ...
@@ -59,7 +59,7 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data,
59 59
         int number, len;
60 60
 
61 61
         ptr += strcspn(ptr, "#");
62
-        if (sscanf(ptr, "#define %256s %u", name, &number) != 2) {
62
+        if (sscanf(ptr, "#define %255s %u", name, &number) != 2) {
63 63
             av_log(avctx, AV_LOG_ERROR, "Unexpected preprocessor directive\n");
64 64
             return AVERROR_INVALIDDATA;
65 65
         }