lavc: free the padded last frame during audio encoding properly
authorAnton Khirnov <anton@khirnov.net>
Tue, 18 Jun 2013 09:41:04 +0000 (11:41 +0200)
committerAnton Khirnov <anton@khirnov.net>
Thu, 20 Jun 2013 14:49:11 +0000 (16:49 +0200)
libavcodec/utils.c

index 3dddafca1064cf86d385addb96fb59c74316ff05..ee0b571f45e2bb6685cc5993e5eb31214c5e223e 100644 (file)
@@ -1245,12 +1245,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
     avpkt->flags |= AV_PKT_FLAG_KEY;
 
 end:
-    if (padded_frame) {
-        av_freep(&padded_frame->data[0]);
-        if (padded_frame->extended_data != padded_frame->data)
-            av_freep(&padded_frame->extended_data);
-        av_freep(&padded_frame);
-    }
+    av_frame_free(&padded_frame);
 
     return ret;
 }