]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/gif.c
Merge commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370'
[ffmpeg] / libavcodec / gif.c
index cf5d438a7283ac45b048a273d8fe5a0a87a1315c..7ac95d26c819726fb5c0efd8a76dee1e2bb9baad 100644 (file)
@@ -221,13 +221,12 @@ static av_cold int gif_encode_init(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_ERROR, "GIF does not support resolutions above 65535x65535\n");
         return AVERROR(EINVAL);
     }
-
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
     avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     s->transparent_index = -1;
 
@@ -320,8 +319,6 @@ static int gif_encode_close(AVCodecContext *avctx)
 {
     GIFContext *s = avctx->priv_data;
 
-    av_frame_free(&avctx->coded_frame);
-
     av_freep(&s->lzw);
     av_freep(&s->buf);
     av_frame_free(&s->last_frame);