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