]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/aaccoder.c
mov_chan: Pass a separate AVIOContext for reading
[ffmpeg] / libavcodec / aaccoder.c
index 36a49a75380f43c03739dc6060df7dd84233f7cd..c2b0e241a9256a4fda2b60ecfdb2e2deb48c505f 100644 (file)
@@ -721,6 +721,9 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
     int allz = 0;
     float minthr = INFINITY;
 
+    // for values above this the decoder might end up in an endless loop
+    // due to always having more bits than what can be encoded.
+    destbits = FFMIN(destbits, 5800);
     //XXX: some heuristic to determine initial quantizers will reduce search time
     //determine zero bands and upper limits
     for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {