aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-30 00:52:04 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-01-13 00:06:07 +0100
commit2a75c0b1ca16b5480497de0d4c79ef122406a0b5 (patch)
tree7e9f8cab8ccea8b12c069ec062565185eff2bd02
parent34e7f70f9f493f340daab80eba4f12d005ec3e63 (diff)
downloadffmpeg-2a75c0b1ca16b5480497de0d4c79ef122406a0b5.tar.gz
aacsbr: change order of operation to prevent out of array read
CC: libav-stable@libav.org Bug-Id: CID 732250
-rw-r--r--libavcodec/aacsbr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c
index 4d2ac6cbd2..dbfb167781 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;