[FFmpeg-cvslog] ff_mp4_read_dec_config_descr: check that the codec is not open

Michael Niedermayer git at videolan.org
Mon Dec 3 18:03:09 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Dec  3 17:27:19 2012 +0100| [4c160b68cca2001101b3286877bf286ff0dd7873] | committer: Michael Niedermayer

ff_mp4_read_dec_config_descr: check that the codec is not open

Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/isom.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index be36f1e..811184b 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -433,6 +433,11 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext
     avio_rb32(pb); /* max bitrate */
     avio_rb32(pb); /* avg bitrate */
 
+    if(avcodec_is_open(st->codec)) {
+        av_log(fc, AV_LOG_DEBUG, "codec open in read_dec_config_descr\n");
+        return -1;
+    }
+
     st->codec->codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id);
     av_dlog(fc, "esds object type id 0x%02x\n", object_type_id);
     len = ff_mp4_read_descr(fc, pb, &tag);



More information about the ffmpeg-cvslog mailing list