You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/libopusenc: Don't free user-provided AVPacket
Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
@@ -503,7 +503,6 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
// Check if subtraction resulted in an overflow
|
// Check if subtraction resulted in an overflow
|
||||||
if ((discard_padding < opus->opts.packet_size) != (avpkt->duration > 0)) {
|
if ((discard_padding < opus->opts.packet_size) != (avpkt->duration > 0)) {
|
||||||
av_packet_unref(avpkt);
|
av_packet_unref(avpkt);
|
||||||
av_free(avpkt);
|
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
if (discard_padding > 0) {
|
if (discard_padding > 0) {
|
||||||
@@ -512,7 +511,6 @@ static int libopus_encode(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);
|
||||||
}
|
}
|
||||||
AV_WL32(side_data + 4, discard_padding);
|
AV_WL32(side_data + 4, discard_padding);
|
||||||
|
Reference in New Issue
Block a user