Commit c2340831 authored by Michael Niedermayer's avatar Michael Niedermayer

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

Fixes CID732250
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 24778c32
......@@ -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;
......
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