diff options
author | Claudio Freire <klaussfreire@gmail.com> | 2015-12-09 17:36:32 -0300 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-12-09 22:29:18 +0100 |
commit | 124c3759386a98e9f47b3305cb18cee5e1707d73 (patch) | |
tree | c93eccb282370508c9a2dafafecae65558cca6a0 /libavcodec/aaccoder.c | |
parent | 7fd1c85e51958050180b37a1bf4ce833d44f91e8 (diff) | |
download | ffmpeg-124c3759386a98e9f47b3305cb18cee5e1707d73.tar.gz |
AAC encoder: fix OOB access in search_for_pns
Fix OOB access in search_for_pns which was using
w2 outside the window group loop, and fix a typo
in which it was checking sf_idx instead of band_type
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r-- | libavcodec/aaccoder.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c index 14862ec3c1..7e55494fe6 100644 --- a/libavcodec/aaccoder.c +++ b/libavcodec/aaccoder.c @@ -711,7 +711,7 @@ static void search_for_pns(AACEncContext *s, AVCodecContext *avctx, SingleChanne /* Estimate rd on average as 5 bits for SF, 4 for the CB, plus spread energy * lambda/thr */ dist2 += band->energy/(band->spread*band->spread)*lambda*dist_thresh/band->threshold; } - if (g && sce->sf_idx[(w+w2)*16+g-1] == NOISE_BT) { + if (g && sce->band_type[w*16+g-1] == NOISE_BT) { dist2 += 5; } else { dist2 += 9; |