Module: libav
Branch: master
Commit: 930ffd46e1e742674aa7cc1c2450020c63b5015b

Author:    Michael Niedermayer <[email protected]>
Committer: Vittorio Giovara <[email protected]>
Date:      Thu Oct 30 00:52:04 2014 +0000

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

CC: [email protected]
Bug-Id: CID 732250

---

 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;

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to