summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-05-16 22:39:03 +0200
committerPaul B Mahol <onemda@gmail.com>2016-05-16 22:39:03 +0200
commit72e33eec3a5e6d04d891e89ef0ab9d42054a6271 (patch)
treeeafdee7ed87043a0bda6c0bfc967cef10e8838ec /libavformat
parent8767470fb572f394104d24acffb70eea9ce48ad3 (diff)
downloadffmpeg-streaming-72e33eec3a5e6d04d891e89ef0ab9d42054a6271.zip
ffmpeg-streaming-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.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c
index f3db282..275710b 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;
OpenPOWER on IntegriCloud