diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-04-17 14:46:11 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-04-17 14:46:11 +0200 |
commit | 6c18200c2f6c19891c7173ae85ac7e9babbe03f3 (patch) | |
tree | c10348e64a9924ac89719e8e89ad20f48278aa8c | |
parent | 197fe392dbb6ef7a9f1b3cecbd074ba468e1ff7b (diff) | |
download | ffmpeg-6c18200c2f6c19891c7173ae85ac7e9babbe03f3.tar.gz |
Only insert the icpf atom in ProRes mkv packets if it isn't already present.
The patch allows to read broken mkv files containing ProRes as written by
the Haali muxer.
Fixes a part of ticket #3434.
-rw-r--r-- | libavformat/matroskadec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 6976da8620..66268fd27b 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2545,7 +2545,8 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska, pkt_data = wv_data; } - if (st->codec->codec_id == AV_CODEC_ID_PRORES) + if (st->codec->codec_id == AV_CODEC_ID_PRORES && + AV_RB32(&data[4]) != MKBETAG('i', 'c', 'p', 'f')) offset = 8; pkt = av_mallocz(sizeof(AVPacket)); @@ -2556,7 +2557,7 @@ static int matroska_parse_frame(MatroskaDemuxContext *matroska, goto fail; } - if (st->codec->codec_id == AV_CODEC_ID_PRORES) { + if (st->codec->codec_id == AV_CODEC_ID_PRORES && offset == 8) { uint8_t *buf = pkt->data; bytestream_put_be32(&buf, pkt_size); bytestream_put_be32(&buf, MKBETAG('i', 'c', 'p', 'f')); |