--- /dev/null
+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
+