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

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

CC: [email protected]
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;

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to