]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ljpegenc.c
Merge commit 'ebe8b5d947c41449c684f17c6826fe6bc46c0360'
[ffmpeg] / libavcodec / ljpegenc.c
index 8c0ebf5e085489d491501b82232f7e18455fc655..c8d5a45a0e2eb83eb0def7189a561414c50d2461 100644 (file)
@@ -265,7 +265,6 @@ static av_cold int ljpeg_encode_close(AVCodecContext *avctx)
 {
     LJpegEncContext *s = avctx->priv_data;
 
-    av_frame_free(&avctx->coded_frame);
     av_freep(&s->scratch);
 
     return 0;
@@ -286,12 +285,12 @@ static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
         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->scratch = av_malloc_array(avctx->width + 1, sizeof(*s->scratch));
     if (!s->scratch)