Revision a91d82b5

View differences:

libavcodec/aacsbr.c
519 519
            odd = (sb + sbr->k[0]) & 1;
520 520
        }
521 521

  
522
        // Requirements (14496-3 sp04 p205) sets the maximum number of patches to 5.
523
        // After this check the final number of patches can still be six which is
524
        // illegal however the Coding Technologies decoder check stream has a final
525
        // count of 6 patches
526
        if (sbr->num_patches > 5) {
527
            av_log(ac->avccontext, AV_LOG_ERROR, "Too many patches: %d\n", sbr->num_patches);
528
            return -1;
529
        }
530

  
522 531
        sbr->patch_num_subbands[sbr->num_patches]  = FFMAX(sb - usb, 0);
523 532
        sbr->patch_start_subband[sbr->num_patches] = sbr->k[0] - odd - sbr->patch_num_subbands[sbr->num_patches];
524 533

  
......
536 545
    if (sbr->patch_num_subbands[sbr->num_patches-1] < 3 && sbr->num_patches > 1)
537 546
        sbr->num_patches--;
538 547

  
539
    // Requirements (14496-3 sp04 p205) sets the maximum number of patches to 5
540
    // However the Coding Technologies decoder check uses 6 patches
541
    if (sbr->num_patches > 6) {
542
        av_log(ac->avccontext, AV_LOG_ERROR, "Too many patches: %d\n", sbr->num_patches);
543
        return -1;
544
    }
545

  
546 548
    return 0;
547 549
}
548 550

  

Also available in: Unified diff