|
|
@ -4879,7 +4879,9 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size, |
|
|
|
case NAL_IDR_SLICE: |
|
|
|
case NAL_IDR_SLICE: |
|
|
|
case NAL_SLICE: |
|
|
|
case NAL_SLICE: |
|
|
|
init_get_bits(&hx->gb, ptr, bit_length); |
|
|
|
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; |
|
|
|
nals_needed = nal_index; |
|
|
|
if (!first_slice) |
|
|
|
if (!first_slice) |
|
|
|
first_slice = hx->nal_unit_type; |
|
|
|
first_slice = hx->nal_unit_type; |
|
|
@ -4927,7 +4929,7 @@ again: |
|
|
|
|
|
|
|
|
|
|
|
switch (hx->nal_unit_type) { |
|
|
|
switch (hx->nal_unit_type) { |
|
|
|
case NAL_IDR_SLICE: |
|
|
|
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, |
|
|
|
av_log(h->avctx, AV_LOG_ERROR, |
|
|
|
"Invalid mix of idr and non-idr slices\n"); |
|
|
|
"Invalid mix of idr and non-idr slices\n"); |
|
|
|
ret = -1; |
|
|
|
ret = -1; |
|
|
|