summaryrefslogtreecommitdiff
path: root/libavformat/isom.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-03 17:27:19 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-03 17:27:52 +0100
commit4c160b68cca2001101b3286877bf286ff0dd7873 (patch)
tree689f3150b8b4ea82235d83066db8ce23c4d7e5fb /libavformat/isom.c
parentf2ceb67e5b425bf7de0649483da7265e2492da0f (diff)
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@gmx.at>
Diffstat (limited to 'libavformat/isom.c')
-rw-r--r--libavformat/isom.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c
index be36f1e157..811184b8b7 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);