]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - aacdec_filter.c
aacdec: Fix a brown paper bag bug.
[paraslash.git] / aacdec_filter.c
index 209c9a4674adfba61f82f8d6e8fac05ec37ccff3..5b84d07e12c4757c4393e0d5da54a3bcbed499a9 100644 (file)
@@ -112,6 +112,7 @@ next_buffer:
                return;
        btr_merge(btrn, fn->min_iqs);
        len = btr_next_buffer(btrn, (char **)&inbuf);
+       len = PARA_MIN(len, (size_t)8192);
        consumed = 0;
        iqs = btr_get_input_queue_size(btrn);
        if (!padd->initialized) {
@@ -185,7 +186,8 @@ next_buffer:
                        padd->frame_info.bytesconsumed);
                PARA_ERROR_LOG("%s\n", NeAACDecGetErrorMessage(
                        padd->frame_info.error));
-               consumed++; /* catch 21 */
+               if (consumed < len)
+                       consumed++; /* catch 21 */
                goto success;
        }
        padd->error_count = 0;