aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-10-22 10:35:09 +0200
committerPaul B Mahol <onemda@gmail.com>2015-10-22 11:01:00 +0200
commit6debfce6a31bf5e5e1aadcf47e0ba6251815a31b (patch)
tree35d1da8b241985c5ca5f6682b81e8234de5e20bf
parent0d7c0274833546bbbd243a109f266294d929ab38 (diff)
downloadffmpeg-6debfce6a31bf5e5e1aadcf47e0ba6251815a31b.tar.gz
avformat/electronicarts: fix demuxing of certain eam files
Such files have gaps between header chunks. Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavformat/electronicarts.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 22a7bc501d..8087c9f5ea 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -662,7 +662,19 @@ static int ea_read_packet(AVFormatContext *s, AVPacket *pkt)
case SCEl_TAG:
case SEND_TAG:
case SEEN_TAG:
- ret = AVERROR(EIO);
+ while (!avio_feof(pb)) {
+ int tag = avio_rl32(pb);
+
+ if (tag == ISNh_TAG ||
+ tag == SCHl_TAG ||
+ tag == SEAD_TAG ||
+ tag == SHEN_TAG) {
+ avio_skip(pb, -4);
+ break;
+ }
+ }
+ if (avio_feof(pb))
+ ret = AVERROR_EOF;
packet_read = 1;
break;