]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/xfaceenc.c
Merge commit '5d8bea3bb2357bb304f8f771a4107039037c5549'
[ffmpeg] / libavcodec / xfaceenc.c
index fa6f22734b773250f57aafd744d86d6d270931c2..38f63e622a37c6592b2ad899ab62912eba1140a7 100644 (file)
@@ -126,9 +126,6 @@ static void encode_block(char *bitmap, int w, int h, int level, ProbRangesQueue
 
 static av_cold int xface_encode_init(AVCodecContext *avctx)
 {
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
 
     return 0;
@@ -205,7 +202,7 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         intbuf[i++] = r + XFACE_FIRST_PRINT;
     }
 
-    if ((ret = ff_alloc_packet2(avctx, pkt, i+2)) < 0)
+    if ((ret = ff_alloc_packet2(avctx, pkt, i+2, 0)) < 0)
         return ret;
 
     /* revert the number, and close the buffer */
@@ -223,8 +220,6 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int xface_encode_close(AVCodecContext *avctx)
 {
-    av_frame_free(&avctx->coded_frame);
-
     return 0;
 }