diff options
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/Makefile | 2 | ||||
-rw-r--r-- | libavformat/wv.c | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index e5ec44bfb6..3d9017b3e4 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -342,4 +342,4 @@ OBJS-$(CONFIG_JACK_INDEV) += timefilter.o TESTPROGS = timefilter -include $(SUBDIR)../subdir.mak +include $(SRC_PATH)/subdir.mak diff --git a/libavformat/wv.c b/libavformat/wv.c index 9da416e580..b2b1eb3c62 100644 --- a/libavformat/wv.c +++ b/libavformat/wv.c @@ -110,6 +110,9 @@ static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb, int appen size = wc->blksize; } wc->flags = AV_RL32(wc->extra + 4); + // blocks with zero samples don't contain actual audio information and should be ignored + if (!AV_RN32(wc->extra)) + return 0; //parse flags bpp = ((wc->flags & 3) + 1) << 3; chan = 1 + !(wc->flags & WV_MONO); @@ -207,8 +210,14 @@ static int wv_read_header(AVFormatContext *s, AVStream *st; wc->block_parsed = 0; - if(wv_read_block_header(s, pb, 0) < 0) - return -1; + for(;;){ + if(wv_read_block_header(s, pb, 0) < 0) + return -1; + if(!AV_RN32(wc->extra)) + avio_skip(pb, wc->blksize - 24); + else + break; + } /* now we are ready: build format streams */ st = av_new_stream(s, 0); |