aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/wv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-07-26 00:14:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-07-26 00:14:04 +0200
commit095946afa7ae6085ee54ef19cff1d3c10b467cec (patch)
treea4356ad2adfab48fd6de1c25da85e37f3ab1451f /libavformat/wv.c
parent6d75dbebc0b7af64cbac62cf32ee5ac0911cbfaa (diff)
parenta05219d801cdf0fd83301e893301e9f6ba0ab6ed (diff)
downloadffmpeg-095946afa7ae6085ee54ef19cff1d3c10b467cec.tar.gz
Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7: (65 commits) riff: Add mpgv MPEG-2 fourcc Update Changelog matroskadec: fix integer underflow if header length < probe length. ffmpeg: fix operation with --disable-avfilter vf_libopencv: replace opencv/cxtypes.h #include by opencv/cxcore.h build: Create mlib optimization directories during out-of-tree builds. changelog: misc typo and wording fixes (cherry picked from commit b047941d7da470ba0dcedb1fd0aa828075265ffc) doc: Remove outdated comments about gcc 2.95 and gcc 3.3 support. (cherry picked from commit 5ccbf80963c1cc54aed97b1c81b1657ab91baf6a) matroskadec: matroska_read_seek after after EBML_STOP leads to failure. Update RELEASE file update Changelog mt: proper locking around release_buffer calls. vp8/mt: flush worker thread, not application thread context, on seek. docs: Mention the upstream bugzilla url about the dlltool vs MSVC issue docs: Use proper markup for a literal command line option docs: Don't recommend adding --enable-memalign-hack docs: Remove needless configure options oggdec: prevent heap corruption. oggdec: Abort Ogg header parsing when encountering a data packet. Add LGPL license boilerplate to files lacking it. ... Conflicts: Changelog configure doc/developer.texi libavcodec/libvpxenc.c libavcodec/rawdec.c libavfilter/x86/gradfun.c libavformat/Makefile libavformat/isom.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/wv.c')
-rw-r--r--libavformat/wv.c13
1 files changed, 11 insertions, 2 deletions
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);