Browse Source

h264: support invalid annex B in mp4

Fixes Ticket1914

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
93b89868e1
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      libavcodec/h264.c

+ 7
- 0
libavcodec/h264.c View File

@@ -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;


Loading…
Cancel
Save