Message ID | CACGufqTitfAsF7Kat-geC-x5R-_gXXVoCc0iQtGy=kqHd-aogg@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel] avcodec/hevc: compatible with mixed use of annexb and hvcc on bitstream like h264dec | expand |
Context | Check | Description |
---|---|---|
andriy/configure_x86 | warning | Failed to apply patch |
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index fd143cddab..59e99493d5 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -3290,6 +3290,13 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) s->eos = 0; s->slice_initialized = 0; + if (s->nal_length_size == 4) { + if (length > 8 && AV_RB32(buf) == 1 && AV_RB32(buf+5) > (unsigned)length) { + s->is_nalff = 0; + } else if (length > 3 && AV_RB32(buf) > 1 && AV_RB32(buf) <= (unsigned)length) + s->is_nalff = 1; + } +