avcodec_encode_audio2: fix memleak on last padded frame
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Jun 2013 13:20:48 +0000 (15:20 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Jun 2013 13:21:23 +0000 (15:21 +0200)
Regression introduced by 799f57ac96f9891d1a0f7d6c4b218ed536e8aca5

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index 8880502..d2fa73f 100644 (file)
@@ -1599,12 +1599,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;
 }