The frontend does not support audio output when the number of channels changes between frames. Check if the number of decoded channels matches the number of audio output channels. It is possible that this condition should be detected in the decoder instead of the frontend. Fixes crash from afl-fuzz.
Unified · Split
| @@ -699,6 +699,10 @@ static int decodeAACfile(char *aacfile, char *sndfile, char *adts_fn, int to_std · 698 unmodified lines | |||
| 699 | /* update buffer indices */ | 699 | /* update buffer indices */ |
| 700 | advance_buffer(&b, frameInfo.bytesconsumed); | 700 | advance_buffer(&b, frameInfo.bytesconsumed); |
| 701 | 701 | ||
| 702 | /* check if the inconsistent number of channels */ | ||
| 703 | if (aufile != NULL && frameInfo.channels != aufile->channels) | ||
| 704 | frameInfo.error = 12; | ||
| 705 | |||
| 702 | if (frameInfo.error > 0) | 706 | if (frameInfo.error > 0) |
| 703 | { | 707 | { |
| 704 | faad_fprintf(stderr, "Error: %s\n", | 708 | faad_fprintf(stderr, "Error: %s\n", |