mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-06 23:04:54 +00:00
avcodec/xpmdec: skip everything before signature
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
01b069c1b8
commit
e73325b971
@ -309,7 +309,10 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
avctx->pix_fmt = AV_PIX_FMT_BGRA;
|
avctx->pix_fmt = AV_PIX_FMT_BGRA;
|
||||||
|
|
||||||
end = avpkt->data + avpkt->size;
|
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");
|
av_log(avctx, AV_LOG_ERROR, "missing signature\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user