From d94d383f13d1a46dec1cba71bf56bdc8c63feb57 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 5 May 2013 00:23:13 +0200 Subject: [PATCH] xbmdec: fix off by one error in scanf() Fixes out of array access Signed-off-by: Michael Niedermayer (cherry picked from commit 88c1b0e7a852e48d9f0e3d79c44edaa86e59acfe) Signed-off-by: Michael Niedermayer --- libavcodec/xbmdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c index b3e4cf2f89..ef27d703fb 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; }