buf += offset;
+ if (buf_end - buf < w * bytes_per_pixel)
+ return AVERROR_INVALIDDATA;
+
if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
return ret;
return offset + w*h*bytes_per_pixel;
}
-AVCodec ff_ptx_decoder = {
+const AVCodec ff_ptx_decoder = {
.name = "ptx",
.long_name = NULL_IF_CONFIG_SMALL("V.Flash PTX image"),
.type = AVMEDIA_TYPE_VIDEO,