[FFmpeg-cvslog] r22413 - trunk/libavcodec/aacsbr.c

alexc subversion
Tue Mar 9 22:50:11 CET 2010


Author: alexc
Date: Tue Mar  9 22:50:10 2010
New Revision: 22413

Log:
aacsbr: Check that bs_num_env is valid before writing arrays with it as an offset.

Modified:
   trunk/libavcodec/aacsbr.c

Modified: trunk/libavcodec/aacsbr.c
==============================================================================
--- trunk/libavcodec/aacsbr.c	Tue Mar  9 22:46:46 2010	(r22412)
+++ trunk/libavcodec/aacsbr.c	Tue Mar  9 22:50:10 2010	(r22413)
@@ -689,7 +689,6 @@ static int read_sbr_grid(AACContext *ac,
         num_rel_lead                        = get_bits(gb, 2);
         num_rel_trail                       = get_bits(gb, 2);
         ch_data->bs_num_env                 = num_rel_lead + num_rel_trail + 1;
-        ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
 
         if (ch_data->bs_num_env > 5) {
             av_log(ac->avccontext, AV_LOG_ERROR,
@@ -698,6 +697,8 @@ static int read_sbr_grid(AACContext *ac,
             return -1;
         }
 
+        ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
+
         for (i = 0; i < num_rel_lead; i++)
             ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2;
         for (i = 0; i < num_rel_trail; i++)



More information about the ffmpeg-cvslog mailing list