diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-05-16 22:39:03 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-05-16 22:39:03 +0200 |
commit | 72e33eec3a5e6d04d891e89ef0ab9d42054a6271 (patch) | |
tree | eafdee7ed87043a0bda6c0bfc967cef10e8838ec /libavformat | |
parent | 8767470fb572f394104d24acffb70eea9ce48ad3 (diff) | |
download | ffmpeg-72e33eec3a5e6d04d891e89ef0ab9d42054a6271.tar.gz |
avcodec/iff: add support for ANIMs with keyframes and concatenated ANIMs
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/iff.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c index f3db2820a5..275710b892 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -834,20 +834,27 @@ static int iff_read_packet(AVFormatContext *s, } else if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && st->codecpar->codec_tag == ID_ANIM) { uint64_t data_size, orig_pos; - uint32_t chunk_id = 0; + uint32_t chunk_id, chunk_id2; while (!avio_feof(pb)) { if (avio_feof(pb)) return AVERROR_EOF; + orig_pos = avio_tell(pb); chunk_id = avio_rl32(pb); data_size = avio_rb32(pb); - orig_pos = avio_tell(pb); + chunk_id2 = avio_rl32(pb); - if (chunk_id == ID_FORM) + if (chunk_id == ID_FORM && + chunk_id2 == ID_ILBM) { + avio_skip(pb, -4); break; - else + } else if (chunk_id == ID_FORM && + chunk_id2 == ID_ANIM) { + continue; + } else { avio_skip(pb, data_size); + } } ret = av_get_packet(pb, pkt, data_size); pkt->pos = orig_pos; |