X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fptx.c;h=19f9305cda09fe60f01a4e4b1e5b175654f0ebfb;hb=117575ae2622d3a42af43f76a1940239c8088292;hp=42147f4afce6d55742d26955cd4d6b9394ccaa03;hpb=73d193d1d0ff62a029a905d1404c0fd357f4c880;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;