mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-23 15:26:57 +00:00
libavcodec/libmp3lame: Don't free user-provided AVPacket
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 7e6941e185
)
This commit is contained in:
parent
8efc398218
commit
68f5905f3c
@ -279,7 +279,6 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) {
|
if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "discard padding overflow\n");
|
av_log(avctx, AV_LOG_ERROR, "discard padding overflow\n");
|
||||||
av_packet_unref(avpkt);
|
av_packet_unref(avpkt);
|
||||||
av_free(avpkt);
|
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
if ((!s->delay_sent && avctx->initial_padding > 0) || discard_padding > 0) {
|
if ((!s->delay_sent && avctx->initial_padding > 0) || discard_padding > 0) {
|
||||||
@ -288,7 +287,6 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
10);
|
10);
|
||||||
if(!side_data) {
|
if(!side_data) {
|
||||||
av_packet_unref(avpkt);
|
av_packet_unref(avpkt);
|
||||||
av_free(avpkt);
|
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
if (!s->delay_sent) {
|
if (!s->delay_sent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user