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

Michael Niedermayer git at videolan.org
Tue Nov 4 22:30:50 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Oct 30 00:52:04 2014 +0000| [930ffd46e1e742674aa7cc1c2450020c63b5015b] | committer: Vittorio Giovara

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

CC: libav-stable at libav.org
Bug-Id: CID 732250

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

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

diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c
index 0363aff..76c1014 100644
--- a/libavcodec/aacsbr.c
+++ b/libavcodec/aacsbr.c
@@ -549,7 +549,8 @@ 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