From: John Stebbins Date: Thu, 23 Feb 2017 22:49:25 +0000 (-0700) Subject: libav: fix crash when encoding aac at high bitrate X-Git-Tag: 1.0.3~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba31c6e22e08bb58a827f960c7e3dc7fd8bf4a6e;p=handbrake libav: fix crash when encoding aac at high bitrate Fixes https://github.com/HandBrake/HandBrake/issues/510 --- diff --git a/contrib/ffmpeg/A14-aacenc-high-bitrate-crash.patch b/contrib/ffmpeg/A14-aacenc-high-bitrate-crash.patch new file mode 100644 index 000000000..06a640460 --- /dev/null +++ b/contrib/ffmpeg/A14-aacenc-high-bitrate-crash.patch @@ -0,0 +1,28 @@ +From 7facbe6793a89ffeda7230d39fce8ccb5ce76208 Mon Sep 17 00:00:00 2001 +From: John Stebbins +Date: Thu, 23 Feb 2017 15:42:02 -0700 +Subject: [PATCH] aacenc: fix crash when encoding at high bitrates + +Increases the size of the AVPacket being written into. Although the aac +spec says the max packet size should be 768 * channel count, aacenc +overshoots this and requires a larger buffer. +--- + libavcodec/aacenc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c +index 9b0e99b..b63affc 100644 +--- a/libavcodec/aacenc.c ++++ b/libavcodec/aacenc.c +@@ -572,7 +572,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, + } + start_ch += chans; + } +- if ((ret = ff_alloc_packet(avpkt, 768 * s->channels))) { ++ if ((ret = ff_alloc_packet(avpkt, 8192 * s->channels))) { + av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n"); + return ret; + } +-- +2.9.3 +