Commit 93b89868 authored by Michael Niedermayer's avatar Michael Niedermayer

h264: support invalid annex B in mp4

Fixes Ticket1914
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c2c17268
......@@ -3763,6 +3763,13 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
ff_h264_reset_sei(h);
}
if (h->nal_length_size == 4) {
if (buf_size > 8 && AV_RB32(buf) == 1 && AV_RB32(buf+5) > (unsigned)buf_size) {
h->is_avc = 0;
}else if(buf_size > 3 && AV_RB32(buf) > 1 && AV_RB32(buf) <= (unsigned)buf_size)
h->is_avc = 1;
}
for (; pass <= 1; pass++) {
buf_index = 0;
context_count = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment