From 6debfce6a31bf5e5e1aadcf47e0ba6251815a31b Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Thu, 22 Oct 2015 10:35:09 +0200 Subject: [PATCH] avformat/electronicarts: fix demuxing of certain eam files Such files have gaps between header chunks. Signed-off-by: Paul B Mahol --- libavformat/electronicarts.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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;