]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pafvideo.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / pafvideo.c
index 22ae26ac102c4c64d122e5d90ffc38f187204fae..bb5c17b6a10ca9c7392b63abc18d3bc2d406485a 100644 (file)
@@ -104,10 +104,8 @@ static av_cold int paf_video_init(AVCodecContext *avctx)
     c->video_size = avctx->width * avctx->height;
     for (i = 0; i < 4; i++) {
         c->frame[i] = av_mallocz(c->frame_size);
-        if (!c->frame[i]) {
-            paf_video_close(avctx);
+        if (!c->frame[i])
             return AVERROR(ENOMEM);
-        }
     }
 
     return 0;
@@ -409,7 +407,7 @@ static int paf_video_decode(AVCodecContext *avctx, void *data,
     return pkt->size;
 }
 
-AVCodec ff_paf_video_decoder = {
+const AVCodec ff_paf_video_decoder = {
     .name           = "paf_video",
     .long_name      = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Video"),
     .type           = AVMEDIA_TYPE_VIDEO,
@@ -419,5 +417,5 @@ AVCodec ff_paf_video_decoder = {
     .close          = paf_video_close,
     .decode         = paf_video_decode,
     .capabilities   = AV_CODEC_CAP_DR1,
-    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
 };