[FFmpeg-cvslog] aacsbr: change order of operation to prevent out of array read

Michael Niedermayer git at videolan.org
Thu Oct 25 21:29:18 CEST 2012


ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 13 00:10:23 2012 +0200| [8b64036038e259abd04d119b6f70df5433e4c04f] | committer: Michael Niedermayer

aacsbr: change order of operation to prevent out of array read

Fixes CID732250
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit c2340831b8e9032716acb0aab4893d3cc500213a)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8b64036038e259abd04d119b6f70df5433e4c04f
---

 libavcodec/aacsbr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c
index 2f457b6..1110bb4 100644
--- a/libavcodec/aacsbr.c
+++ b/libavcodec/aacsbr.c
@@ -542,7 +542,7 @@ static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
             k = sbr->n_master;
     } while (sb != sbr->kx[1] + sbr->m[1]);
 
-    if (sbr->patch_num_subbands[sbr->num_patches-1] < 3 && sbr->num_patches > 1)
+    if (sbr->num_patches > 1 && sbr->patch_num_subbands[sbr->num_patches-1] < 3)
         sbr->num_patches--;
 
     return 0;



More information about the ffmpeg-cvslog mailing list