[FFmpeg-devel] [PATCH] wma decoder return value does not fit actually used data

Reimar Döffinger Reimar.Doeffinger
Fri Nov 30 17:43:51 CET 2007


Hello,
currently the wma decoder always returns s->block_align, but actually it
(tries to) use up all data in the input buffer.
Even worse, it also returns s->block_align when the buffer size is
smaller than that.
There are two ways to fix it: either change the return value to return
the size of the buffer or use s->block_align as buffer size.
The former has the disadvantage that we would then need a separate
AVParser (AFAICT), whereas the latter fixes the playback problems in
both ffplay and mplayer without further changes.
A sample file is incoming/wmabugs.wmv , which plays fine with attached
patch.
Does it look okay to apply to you?

Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: libavcodec/wmadec.c
===================================================================
--- libavcodec/wmadec.c	(revision 11113)
+++ libavcodec/wmadec.c	(working copy)
@@ -768,6 +768,9 @@
         s->last_superframe_len = 0;
         return 0;
     }
+    if (buf_size < s->block_align)
+        return 0;
+    buf_size = s->block_align;
 
     samples = data;
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071130/18ff0778/attachment.pgp>



More information about the ffmpeg-devel mailing list