diff options
author | Paul B Mahol <onemda@gmail.com> | 2017-03-12 15:07:02 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2017-03-12 18:24:49 +0100 |
commit | e73325b971b37dd4741c49541c74cde0739dab8c (patch) | |
tree | c6b23d8b39b99e803d0df8e74d06fc08feb9216b /libavcodec/xpmdec.c | |
parent | 01b069c1b81f68373f4401a611f1b8a4ad552895 (diff) | |
download | ffmpeg-e73325b971b37dd4741c49541c74cde0739dab8c.tar.gz |
avcodec/xpmdec: skip everything before signature
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/xpmdec.c')
-rw-r--r-- | libavcodec/xpmdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/xpmdec.c b/libavcodec/xpmdec.c index 8d5bc76ab2..6cd7bde4ec 100644 --- a/libavcodec/xpmdec.c +++ b/libavcodec/xpmdec.c @@ -309,7 +309,10 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data, avctx->pix_fmt = AV_PIX_FMT_BGRA; end = avpkt->data + avpkt->size; - if (memcmp(ptr, "/* XPM */", 9)) { + while (memcmp(ptr, "/* XPM */\n", 10) && ptr < end - 10) + ptr++; + + if (ptr >= end) { av_log(avctx, AV_LOG_ERROR, "missing signature\n"); return AVERROR_INVALIDDATA; } |