mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user