aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-27 18:06:00 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-27 18:06:00 +0100
commit93b89868e139e9b45dfc8a62b4f8e1832bbfd5d8 (patch)
treede176b1f6ac3efa2d80ac2b0ecc4724b4f5498ff /libavcodec/h264.c
parentc2c1726847fe3a043762062db40774bf0cc434c3 (diff)
downloadffmpeg-93b89868e139e9b45dfc8a62b4f8e1832bbfd5d8.tar.gz
h264: support invalid annex B in mp4
Fixes Ticket1914 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 33803bfe86..14843cf24e 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -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;