Bug#635906: Patch for Division by zero in ov_read_filter

Daniel Exner dex at dragonslave.de
Mon Jun 18 20:18:29 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

I ran into a SIPFPE from libvorbisfile while trying to run FoFiX.
I traced it down to a missing null check.
See attached patch for a fix, that should also fix the bug in Debian BTS.
Thanks!

Greetings
Daniel Exner
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iF4EAREIAAYFAk/fjQUACgkQIL9GFNSEFHzcJQD+Munhex1zXax324KwIQDFY6Pn
pA50KkvHswbb7Bl96AgA/2PCYKJAQI6Ps0CH9rfaBRej9X/QNzDNxgUUX+AtVNZ+
=VnfE
-----END PGP SIGNATURE-----
-------------- next part --------------
--- libvorbis-1.3.3/lib/vorbisfile.c	2010-10-27 16:54:00.000000000 +0200
+++ libvorbis-1.3.3.new/lib/vorbisfile.c	2012-06-18 22:05:48.000000000 +0200
@@ -1902,7 +1902,8 @@
     long channels=ov_info(vf,-1)->channels;
     long bytespersample=word * channels;
     vorbis_fpu_control fpu;
-    if(samples>length/bytespersample)samples=length/bytespersample;
+    if(bytespersample && samples>length/bytespersample)
+     samples=length/bytespersample;
 
     if(samples <= 0)
       return OV_EINVAL;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ov_read_filter.patch.sig
Type: application/octet-stream
Size: 96 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-xiph-maint/attachments/20120618/af0663aa/attachment.obj>


More information about the pkg-xiph-maint mailing list