[FFmpeg-cvslog] avcodec/aacdec_template: Check id_map

Michael Niedermayer git at videolan.org
Sun Jan 10 19:50:10 CET 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Jan 10 19:29:39 2016 +0100| [590863876d1478547640304a31c15809c3618090] | committer: Michael Niedermayer

avcodec/aacdec_template: Check id_map

Fixes index out of bounds error
Fixes: aac_index_out_of_bounds.wmv

Found-by: Piotr Bandurski <ami_stuff at o2.pl>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/aacdec_template.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index d819958..6bc94c8 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -451,6 +451,10 @@ static int output_configure(AACContext *ac,
         int type =         layout_map[i][0];
         int id =           layout_map[i][1];
         id_map[type][id] = type_counts[type]++;
+        if (id_map[type][id] >= MAX_ELEM_ID) {
+            avpriv_request_sample(ac->avctx, "Remapped id too large\n");
+            return AVERROR_PATCHWELCOME;
+        }
     }
     // Try to sniff a reasonable channel order, otherwise output the
     // channels in the order the PCE declared them.



More information about the ffmpeg-cvslog mailing list