From c2340831b8e9032716acb0aab4893d3cc500213a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 13 Oct 2012 00:10:23 +0200 Subject: [PATCH] aacsbr: change order of operation to prevent out of array read Fixes CID732250 Signed-off-by: Michael Niedermayer --- libavcodec/aacsbr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c index b4fc761fa1..db0954ba1a 100644 --- a/libavcodec/aacsbr.c +++ b/libavcodec/aacsbr.c @@ -555,7 +555,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;