Browse Source

avcodec/xpmdec: skip everything before signature

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n3.3
Paul B Mahol 8 years ago
parent
commit
e73325b971
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/xpmdec.c

+ 4
- 1
libavcodec/xpmdec.c View File

@@ -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;
}


Loading…
Cancel
Save