[Ffmpeg-devel] wma v2 decoding - attempt at fixing

Reimar Döffinger Reimar.Doeffinger
Mon Dec 26 13:04:41 CET 2005


Hi,
On Sun, Dec 25, 2005 at 07:54:08PM +0100, Reimar D?ffinger wrote:
> the attached patch is what my test resulted in so far.
> The sample I looked at was:
> With this patch, about 10% instead of 0% of it decode correctly.
> The patch is crappy, ugly and sure opens a few security holes, but since
> I won't work on it for the next few weeks (on holiday without PC :-) ),
> I thought posting it won't hurt. Hopefully someone can find the real
> fix ;-)...

I at least found a real fix for most (all?) of the files at
http://tranquillity.campus.luth.se/~banan/WMA/
Maybe someone can now find the condition when that * 2 is necessary??

Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: libavcodec/wmadec.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/wmadec.c,v
retrieving revision 1.26
diff -u -r1.26 wmadec.c
--- libavcodec/wmadec.c	17 Dec 2005 18:14:31 -0000	1.26
+++ libavcodec/wmadec.c	26 Dec 2005 12:04:03 -0000
@@ -284,7 +284,7 @@
     }
 
     bps = (float)s->bit_rate / (float)(s->nb_channels * s->sample_rate);
-    s->byte_offset_bits = av_log2((int)(bps * s->frame_len / 8.0)) + 2;
+    s->byte_offset_bits = av_log2((int)(bps * s->frame_len * 2 / 8.0)) + 2;
 
     /* compute high frequency value and choose if noise coding should
        be activated */



More information about the ffmpeg-devel mailing list