X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fxl.c;h=78f34afa4e399f67ac8c080957ebc6d64be71934;hb=018a6645bc606b545e6efdd980d9449c33e09b00;hp=c29e8b319010beb3beb94d6511fed39225f976ad;hpb=ec8a3e25d8cfed9f8f335b88d8162ae331b68df9;p=ffmpeg diff --git a/libavcodec/xl.c b/libavcodec/xl.c index c29e8b31901..78f34afa4e3 100644 --- a/libavcodec/xl.c +++ b/libavcodec/xl.c @@ -68,6 +68,12 @@ static int decode_frame(AVCodecContext *avctx, V = a->pic.data[2]; stride = avctx->width - 4; + + if (buf_size < avctx->width * avctx->height) { + av_log(avctx, AV_LOG_ERROR, "Packet is too small\n"); + return AVERROR_INVALIDDATA; + } + for (i = 0; i < avctx->height; i++) { /* lines are stored in reversed order */ buf += stride;