[FFmpeg-cvslog] avcodec/dcadec: Check active_bands

Michael Niedermayer git at videolan.org
Sat May 16 00:16:27 CEST 2015


ffmpeg | branch: release/2.6 | Michael Niedermayer <michaelni at gmx.at> | Fri May 15 18:29:40 2015 +0200| [88217c40b667a09512d0f046c1e473548169b376] | committer: Michael Niedermayer

avcodec/dcadec: Check active_bands

Fixes CID1297594 part2

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit fc624ec9ba7e5c4e8d905ac10f605a43d123f95a)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88217c40b667a09512d0f046c1e473548169b376
---

 libavcodec/dcadec.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index 1f9528a..7940cd9 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -1132,8 +1132,13 @@ int ff_dca_xbr_parse_frame(DCAContext *s)
     for(i = 0; i < num_chsets; i++) {
         n_xbr_ch[i] = get_bits(&s->gb, 3) + 1;
         k = get_bits(&s->gb, 2) + 5;
-        for(j = 0; j < n_xbr_ch[i]; j++)
+        for(j = 0; j < n_xbr_ch[i]; j++) {
             active_bands[i][j] = get_bits(&s->gb, k) + 1;
+            if (active_bands[i][j] > DCA_SUBBANDS) {
+                av_log(s->avctx, AV_LOG_ERROR, "too many active subbands (%d)\n", active_bands[i][j]);
+                return AVERROR_INVALIDDATA;
+            }
+        }
     }
 
     /* skip to the end of the header */



More information about the ffmpeg-cvslog mailing list