1 May 2010 01:08
r22999 - trunk/libavcodec/aacsbr.c
alexc <subversion <at> mplayerhq.hu>
2010-04-30 23:08:44 GMT
2010-04-30 23:08:44 GMT
Author: alexc
Date: Sat May 1 01:08:44 2010
New Revision: 22999
Log:
Move the SBR patch count check to prevent overwrites.
Thanks to Chromium.
Modified:
trunk/libavcodec/aacsbr.c
Modified: trunk/libavcodec/aacsbr.c
==============================================================================
--- trunk/libavcodec/aacsbr.c Sat May 1 00:42:52 2010 (r22998)
+++ trunk/libavcodec/aacsbr.c Sat May 1 01:08:44 2010 (r22999)
<at> <at> -519,6 +519,15 <at> <at> static int sbr_hf_calc_npatches(AACConte
odd = (sb + sbr->k[0]) & 1;
}
+ // Requirements (14496-3 sp04 p205) sets the maximum number of patches to 5.
+ // After this check the final number of patches can still be six which is
+ // illegal however the Coding Technologies decoder check stream has a final
+ // count of 6 patches
+ if (sbr->num_patches > 5) {
+ av_log(ac->avccontext, AV_LOG_ERROR, "Too many patches: %d\n", sbr->num_patches);
+ return -1;
+ }
+
sbr->patch_num_subbands[sbr->num_patches] = FFMAX(sb - usb, 0);
(Continue reading)
, but shouldn't it use FFALIGN?
Applied.
RSS Feed