X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fkgv1dec.c;h=a6bd9400ac16fe93bd2a1758ee9a8977610acc30;hb=e836a0b3fd6943f77f54d65ee4ac1005e71d1162;hp=5359411c7619015b108cb40451393551f56154a8;hpb=d168ff70ea41234b01c21e2d19151e9db3a21f90;p=ffmpeg diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index 5359411c761..a6bd9400ac1 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -62,6 +62,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, h = (buf[1] + 1) * 8; buf += 2; + if (avpkt->size < 2 + w*h / 513) + return AVERROR_INVALIDDATA; + if (w != avctx->width || h != avctx->height) { av_freep(&c->frame_buffer); av_freep(&c->last_frame_buffer);