diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-04 06:32:39 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-04 06:32:48 +0100 |
commit | cb8180885f225df6ee6f03ac157aa7617a06ff50 (patch) | |
tree | ff2b46d39aac68b17243d63a3400fb32d9ddfb59 | |
parent | e2781db62a406114519d55c31dd534db6d60dd0d (diff) | |
parent | 62ed6da016b789eee00e0fff517df4a254e12e5d (diff) | |
download | ffmpeg-cb8180885f225df6ee6f03ac157aa7617a06ff50.tar.gz |
Merge commit '62ed6da016b789eee00e0fff517df4a254e12e5d' into release/1.1
* commit '62ed6da016b789eee00e0fff517df4a254e12e5d':
h264: check that an IDR NAL only contains I slices
mov: Free an earlier allocated array if allocating a new one
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264.c | 6 | ||||
-rw-r--r-- | libavformat/mov.c | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index cd088e17b0..d7ec5d959a 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2726,6 +2726,12 @@ static int decode_slice_header(H264Context *h, H264Context *h0) h->slice_type = slice_type; h->slice_type_nos = slice_type & 3; + if (h->nal_unit_type == NAL_IDR_SLICE && + h->slice_type_nos != AV_PICTURE_TYPE_I) { + av_log(h->s.avctx, AV_LOG_ERROR, "A non-intra slice in an IDR NAL unit.\n"); + return AVERROR_INVALIDDATA; + } + // to make a few old functions happy, it's wrong though s->pict_type = h->slice_type; diff --git a/libavformat/mov.c b/libavformat/mov.c index 1e6e1140a6..0f0c411373 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1808,6 +1808,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (entries >= UINT_MAX / sizeof(*sc->stts_data)) return -1; + av_free(sc->stts_data); sc->stts_data = av_malloc(entries * sizeof(*sc->stts_data)); if (!sc->stts_data) return AVERROR(ENOMEM); |