diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-27 15:49:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-27 15:49:25 +0100 |
commit | 4f4cc43fd8514e0e3671c8c4d895dc4406437327 (patch) | |
tree | 5a13a3f7cf5fc1a202579a06355cf9e37f239762 /libavcodec/h264.c | |
parent | 622d24e4ebde51dd1ef76c184d54cbceb42e9d22 (diff) | |
download | ffmpeg-4f4cc43fd8514e0e3671c8c4d895dc4406437327.tar.gz |
avcodec/h264: allow mixing idr and non idr slices with frame threading again
This combination exists in the wild
Fixes Ticket3131
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 012319e8d4..088083462d 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -4879,7 +4879,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size, case NAL_IDR_SLICE: case NAL_SLICE: init_get_bits(&hx->gb, ptr, bit_length); - if (!get_ue_golomb(&hx->gb) || !first_slice) + if (!get_ue_golomb(&hx->gb) || + !first_slice || + first_slice != hx->nal_unit_type) nals_needed = nal_index; if (!first_slice) first_slice = hx->nal_unit_type; @@ -4927,7 +4929,7 @@ again: switch (hx->nal_unit_type) { case NAL_IDR_SLICE: - if (first_slice != NAL_IDR_SLICE) { + if (h->nal_unit_type != NAL_IDR_SLICE) { av_log(h->avctx, AV_LOG_ERROR, "Invalid mix of idr and non-idr slices\n"); ret = -1; |