]> granicus.if.org Git - handbrake/commitdiff
libav: fix crash when encoding aac at high bitrate
authorJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 23 Feb 2017 22:49:25 +0000 (15:49 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Fri, 24 Feb 2017 00:10:51 +0000 (17:10 -0700)
Fixes https://github.com/HandBrake/HandBrake/issues/510

contrib/ffmpeg/A14-aacenc-high-bitrate-crash.patch [new file with mode: 0644]

diff --git a/contrib/ffmpeg/A14-aacenc-high-bitrate-crash.patch b/contrib/ffmpeg/A14-aacenc-high-bitrate-crash.patch
new file mode 100644 (file)
index 0000000..06a6404
--- /dev/null
@@ -0,0 +1,28 @@
+From 7facbe6793a89ffeda7230d39fce8ccb5ce76208 Mon Sep 17 00:00:00 2001
+From: John Stebbins <stebbins@jetheaddev.com>
+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
+