]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ptx.c
avutil/hwcontext_vulkan: fix format specifiers for some printed variables
[ffmpeg] / libavcodec / ptx.c
index 42147f4afce6d55742d26955cd4d6b9394ccaa03..47b8926f73febc38301d13efe716c691ae30337c 100644 (file)
@@ -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;
 
@@ -82,7 +85,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     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,