avcodec_encode_audio2: fix memleak on last padded frame

Regression introduced by 799f57ac96

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-06-14 15:20:48 +02:00
parent d891d354c5
commit 7fff3df6b2

View 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;
}