X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fptx.c;h=19f9305cda09fe60f01a4e4b1e5b175654f0ebfb;hb=6eab25fd1369e52930a19eaf0f3338bbd84e5e7b;hp=42147f4afce6d55742d26955cd4d6b9394ccaa03;hpb=79025da3f2e7ab047c8f3c0c817952a98480b26b;p=ffmpeg diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index 42147f4afce..19f9305cda0 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -55,6 +55,9 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, buf += offset; + if (buf_end - buf < w * bytes_per_pixel) + return AVERROR_INVALIDDATA; + if ((ret = ff_set_dimensions(avctx, w, h)) < 0) return ret;