Oops, we were using PARA_MAX() instead of PARA_MIN() to determine
the number of bytes to convert in the next run. This silly bug could
lead to a segfault in the aacdec filter. Moreover, the assertion in
buffer_tree.c that would have caught the bug was _also_ b0rken.
But it's not my fault. I blame Grover of the Sesame street for both
bugs. He did explain the difference between near and far, although
this knowledge is next to useless for a programmer. And he did not
say a single word about MIN and MAX, or true and false. No wonder
such bugs happen.
return;
btr_merge(btrn, fn->min_iqs);
len = btr_next_buffer(btrn, (char **)&inbuf);
- len = PARA_MAX(len, (size_t)8192);
+ len = PARA_MIN(len, (size_t)8192);
consumed = 0;
iqs = btr_get_input_queue_size(btrn);
if (!padd->initialized) {
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;
numbytes -= br->btrb->size - br->consumed;
btr_drop_buffer_reference(br);
}
- assert(true);
+ assert(false);
}
/*
* We have a wrap buffer, consume from it. If in total, i.e. including