[PATCH] avformat/wavdec: allow data chunk to be before fmt/xma2 chunk
Signed-off-by: Paul B Mahol <onemda@gmail.com> --- libavformat/wavdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 621d21f..144e1b7 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; -- 1.9.1
On Sun, Nov 08, 2015 at 12:34:21PM +0100, Paul B Mahol wrote:
Signed-off-by: Paul B Mahol <onemda@gmail.com> --- libavformat/wavdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 621d21f..144e1b7 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;
if fmt/xma2 existence isnt checked at data time then i think it should be checked at the end of the loop unless iam missing somethig [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB it is not once nor twice but times without number that the same ideas make their appearance in the world. -- Aristotle
On 11/9/15, Michael Niedermayer <michael@niedermayer.cc> wrote:
On Sun, Nov 08, 2015 at 12:34:21PM +0100, Paul B Mahol wrote:
Signed-off-by: Paul B Mahol <onemda@gmail.com> --- libavformat/wavdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 621d21f..144e1b7 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;
if fmt/xma2 existence isnt checked at data time then i think it should be checked at the end of the loop unless iam missing somethig
It wouldn't create any stream. Will check for that too.
[...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
it is not once nor twice but times without number that the same ideas make their appearance in the world. -- Aristotle
participants (2)
-
Michael Niedermayer -
Paul B Mahol