aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/wavdec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-11-08 12:27:42 +0100
committerPaul B Mahol <onemda@gmail.com>2015-11-10 19:42:21 +0100
commit4e583eda5f5c334fe60d5628c805c3d197f35bc2 (patch)
treee81a44c0e2b2c0441dd86f13d199ad81318d373e /libavformat/wavdec.c
parenta0f75c46d31c8421c376b8f9a75a6021c51ccdd3 (diff)
downloadffmpeg-4e583eda5f5c334fe60d5628c805c3d197f35bc2.tar.gz
avformat/wavdec: allow data chunk to be before fmt/xma2 chunk
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/wavdec.c')
-rw-r--r--libavformat/wavdec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 4190fc6093..d95596f6ed 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -379,7 +379,7 @@ static int wav_read_header(AVFormatContext *s)
got_xma2 = 1;
break;
case MKTAG('d', 'a', 't', 'a'):
- if (!got_fmt && !got_xma2) {
+ if (!pb->seekable && !got_fmt && !got_xma2) {
av_log(s, AV_LOG_ERROR,
"found no 'fmt ' tag before the 'data' tag\n");
return AVERROR_INVALIDDATA;
@@ -474,6 +474,11 @@ static int wav_read_header(AVFormatContext *s)
}
break_loop:
+ if (!got_fmt && !got_xma2) {
+ av_log(s, AV_LOG_ERROR, "no 'fmt ' or 'XMA2' tag found\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (data_ofs < 0) {
av_log(s, AV_LOG_ERROR, "no 'data' tag found\n");
return AVERROR_INVALIDDATA;