Commit 930ffd46 authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Vittorio Giovara

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

CC: libav-stable@libav.org
Bug-Id: CID 732250
parent 9f6f4074
...@@ -549,7 +549,8 @@ static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr) ...@@ -549,7 +549,8 @@ static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
k = sbr->n_master; k = sbr->n_master;
} while (sb != sbr->kx[1] + sbr->m[1]); } 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--; sbr->num_patches--;
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment