From a5f8417db587f54daae0340fc88f684cb41d020c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= <Reimar.Doeffinger@gmx.de>
Date: Sun, 29 Apr 2012 15:56:12 +0200
Subject: [PATCH] xbmdec: fix decoding when variable name contains an 'x'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes trac ticket #1142.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
---
 libavcodec/xbmdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c
index 629a636e6ad..b3e4cf2f89e 100644
--- a/libavcodec/xbmdec.c
+++ b/libavcodec/xbmdec.c
@@ -83,6 +83,9 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data,
     if ((ret = avctx->get_buffer(avctx, p)) < 0)
         return ret;
 
+    // goto start of image data
+    ptr += strcspn(ptr, "{") + 1;
+
     linesize = (avctx->width + 7) / 8;
     for (i = 0; i < avctx->height; i++) {
         dst = p->data[0] + i * p->linesize[0];
-- 
GitLab