[Ffmpeg-devel] wavpack decode bad data_size return in some case

Reimar Döffinger Reimar.Doeffinger
Mon Mar 19 19:32:03 CET 2007


Hello,
currently wavpack decoding in some cases may return with a non-error
value but without setting data_size.
This is esp. a problem since decode_audio2 was introduced, since now the
decoding application will think that the whole buffer was filled with
decoded data, but in reality nothing was decoded.
A sample is click-sound.wv in incoming, the corresponding .txt explains
how to hear the problem with MPlayer and -ao pcm, with ffmpeg the
decoded file only got longer.
Attached patch is one way to fix.

Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: libavcodec/wavpack.c
===================================================================
--- libavcodec/wavpack.c	(revision 8437)
+++ libavcodec/wavpack.c	(working copy)
@@ -383,6 +383,7 @@
     uint8_t* buf_end = buf + buf_size;
     int i, j, id, size, ssize, weights, t;
 
+    *data_size = 0;
     if (buf_size == 0) return 0;
 
     memset(s->decorr, 0, MAX_TERMS * sizeof(Decorr));



More information about the ffmpeg-devel mailing list