aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/aacsbr.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-30 00:52:04 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-11-04 09:28:45 -0500
commit930ffd46e1e742674aa7cc1c2450020c63b5015b (patch)
tree089093db2305678579068293d6e651fe3833a91b /libavcodec/aacsbr.c
parent9f6f407463ff8b7681befd04b6655bb7c6d9b3e1 (diff)
downloadffmpeg-930ffd46e1e742674aa7cc1c2450020c63b5015b.tar.gz
aacsbr: change order of operation to prevent out of array read
CC: libav-stable@libav.org Bug-Id: CID 732250
Diffstat (limited to 'libavcodec/aacsbr.c')
-rw-r--r--libavcodec/aacsbr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c
index 0363aff2aa..76c1014cce 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;