aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-13 00:10:23 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-13 00:31:21 +0200
commitc2340831b8e9032716acb0aab4893d3cc500213a (patch)
treec69ce8478f3e8ddb0505b4f9c392809487fabda0 /libavcodec
parent24778c32d80e4045401e4c09ea3f9c12c431167e (diff)
downloadffmpeg-c2340831b8e9032716acb0aab4893d3cc500213a.tar.gz
aacsbr: change order of operation to prevent out of array read
Fixes CID732250 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aacsbr.c2
1 files changed, 1 insertions, 1 deletions
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;