Yet another thing not mentioned in the spec.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -572,9 +572,15 @@ static int decode_spectrum_and_dequant_ac(AACDecContext *s, float coef[1024], · 571 unmodified lines | ||
| 572 | 572 | int gb_count; |
| 573 | 573 | GetBitContext gb2; |
| 574 | 574 | |
| 575 | − ff_aac_ac_init(&ac, gb); | |
| 576 | 575 | c = ff_aac_ac_map_process(state, reset, N); |
| 577 | 576 | |
| 577 | + if (!len) { | |
| 578 | + ff_aac_ac_finish(state, 0, N); | |
| 579 | + return 0; | |
| 580 | + } | |
| 581 | + | |
| 582 | + ff_aac_ac_init(&ac, gb); | |
| 583 | + | |
| 578 | 584 | /* Backup reader for rolling back by 14 bits at the end */ |
| 579 | 585 | gb2 = *gb; |
| 580 | 586 | gb_count = get_bits_count(&gb2); |