]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/anm.c
av_tempfile: Pass int log_offset, void *log_ctx
[ffmpeg] / libavcodec / anm.c
index 02244f70e1c0df1abec5f0fc308beb3be90a0afc..188f8296f3d1f9b92b34fa81c23d7aba8c9d0ad1 100644 (file)
@@ -79,6 +79,8 @@ static inline int op(uint8_t **dst, const uint8_t *dst_end,
         int striplen = FFMIN(count, remaining);
         if (buf) {
             striplen = FFMIN(striplen, buf_end - *buf);
+            if (*buf >= buf_end)
+                goto exhausted;
             memcpy(*dst, *buf, striplen);
             *buf += striplen;
         } else if (pixel >= 0)
@@ -184,14 +186,13 @@ static av_cold int decode_end(AVCodecContext *avctx)
 }
 
 AVCodec ff_anm_decoder = {
-    "anm",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_ANM,
-    sizeof(AnmContext),
-    decode_init,
-    NULL,
-    decode_end,
-    decode_frame,
-    CODEC_CAP_DR1,
+    .name           = "anm",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_ANM,
+    .priv_data_size = sizeof(AnmContext),
+    .init           = decode_init,
+    .close          = decode_end,
+    .decode         = decode_frame,
+    .capabilities   = CODEC_CAP_DR1,
     .long_name = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"),
 };