[FFmpeg-cvslog] aacsbr: change order of operation to prevent out of array read
Michael Niedermayer
git at videolan.org
Sat Oct 13 00:36:00 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 13 00:10:23 2012 +0200| [c2340831b8e9032716acb0aab4893d3cc500213a] | committer: Michael Niedermayer
aacsbr: change order of operation to prevent out of array read
Fixes CID732250
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c2340831b8e9032716acb0aab4893d3cc500213a
---
libavcodec/aacsbr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c
index b4fc761..db0954b 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;
More information about the ffmpeg-cvslog
mailing list