Bug#696716: unblock: pyvorbis/1.5-2
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
Please unblock package pyvorbis
It fixes a crash when calling read() method.
unblock pyvorbis/1.5-2
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.6-trunk-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru pyvorbis-1.5/debian/changelog pyvorbis-1.5/debian/changelog
--- pyvorbis-1.5/debian/changelog 2011-08-17 17:47:52.000000000 +0200
+++ pyvorbis-1.5/debian/changelog 2012-12-26 12:38:03.000000000 +0100
@@ -1,3 +1,12 @@
+pyvorbis (1.5-2) unstable; urgency=low
+
+ * debian/patches/03_fix_call_to_ov_read.patch
+ - fix a crash ("Floating point exception") when calling read(); thanks to
+ Alessio Gaeta for the report and to Emmanuel Anne for the patch;
+ Closes: #696640
+
+ -- Sandro Tosi <morph@debian.org> Wed, 26 Dec 2012 12:37:57 +0100
+
pyvorbis (1.5-1) unstable; urgency=low
* New upstream release
diff -Nru pyvorbis-1.5/debian/patches/03_fix_call_to_ov_read.patch pyvorbis-1.5/debian/patches/03_fix_call_to_ov_read.patch
--- pyvorbis-1.5/debian/patches/03_fix_call_to_ov_read.patch 1970-01-01 01:00:00.000000000 +0100
+++ pyvorbis-1.5/debian/patches/03_fix_call_to_ov_read.patch 2012-12-26 12:37:28.000000000 +0100
@@ -0,0 +1,90 @@
+Description: Fix the crash/no sound while trying to play fofix/guitar hero
+ This mod was trying to force a prototype on an array of callbacks, it's a
+ miracle that it ever worked, maybe older versions of python were more
+ forgiving, or recent versions of libc don't let this kind of thing to
+ pass...
+ .
+ Also changed the memory allocation of py_ov_read to something simpler
+Origin: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670062#10
+Bug-Debian: http://bugs.debian.org/696640
+Forwarded: https://groups.google.com/d/topic/pyogg/IuvxXV5UgP4/discussion
+
+--- pyvorbis-1.5.orig/src/pyvorbisfile.c
++++ pyvorbis-1.5/src/pyvorbisfile.c
+@@ -35,7 +35,7 @@ length is the number of bytes to read\n\
+ \tbigendian is the endianness you want (defaults to host endianness)\n\
+ \tword is the word size\n\tnot sure what signed does\n";
+
+-static PyObject *py_ov_read(PyObject *, PyObject *, PyObject *);
++static PyObject *py_ov_read(PyObject *, PyObject *); // , PyObject *);
+
+ FDEF(ov_streams) "Returns the number of logical streams in this VorbisFile";
+ FDEF(ov_seekable) "Returns whether this VorbisFile is seekable.";
+@@ -119,7 +119,7 @@ PyTypeObject py_vorbisfile_type = {
+
+
+ static PyMethodDef OggVorbis_File_methods[] = {
+- {"read", (PyCFunction) py_ov_read,
++ {"read", py_ov_read,
+ METH_VARARGS | METH_KEYWORDS, py_ov_read_doc},
+ {"info", py_ov_info,
+ METH_VARARGS, py_ov_info_doc},
+@@ -288,7 +288,7 @@ static int is_big_endian() {
+ }
+
+ static PyObject *
+-py_ov_read(PyObject *self, PyObject *args, PyObject *kwdict)
++py_ov_read(PyObject *self, PyObject *args) // , PyObject *kwdict)
+ {
+ py_vorbisfile * ov_self = (py_vorbisfile *) self;
+ PyObject *retobj;
+@@ -298,7 +298,7 @@ py_ov_read(PyObject *self, PyObject *arg
+ PyObject *tuple;
+ char *buff;
+
+- int length, word, sgned, bitstream;
++ int length, word, sgned, bitstream = 0;
+ int bigendianp;
+
+ // Default to host order
+@@ -307,33 +307,23 @@ py_ov_read(PyObject *self, PyObject *arg
+ word = 2;
+ sgned = 1;
+
+- if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|llll", read_kwlist,
++/* if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|llll", read_kwlist,
+ &length, &bigendianp, &word, &sgned))
+- return NULL;
+-
+- buffobj = PyBuffer_New(length);
+-
+- tuple = PyTuple_New(1);
+- Py_INCREF(buffobj);
+- PyTuple_SET_ITEM(tuple, 0, buffobj);
++ return NULL; */
+
+- if (!(PyArg_ParseTuple(tuple, "t#", &buff, &length))) {
+- return NULL;
+- }
+- Py_DECREF(tuple);
++ buff = malloc(length);
++ if (!buff) return NULL;
+
+- Py_BEGIN_ALLOW_THREADS
+ retval = ov_read(ov_self->ovf, buff, length,
+ bigendianp, word, sgned, &bitstream);
+- Py_END_ALLOW_THREADS
+
+ if (retval < 0) {
+- Py_DECREF(buffobj);
++ free(buff);
+ return v_error_from_code(retval, "Error reading file: ");
+ }
+
+- retobj = Py_BuildValue("Oii", buffobj, retval, bitstream);
+- Py_DECREF(buffobj);
++ retobj = Py_BuildValue("s#ii", buff, retval, retval, bitstream);
++ free(buff);
+ return retobj;
+ }
+
diff -Nru pyvorbis-1.5/debian/patches/series pyvorbis-1.5/debian/patches/series
--- pyvorbis-1.5/debian/patches/series 2011-08-17 17:15:18.000000000 +0200
+++ pyvorbis-1.5/debian/patches/series 2012-12-26 12:37:28.000000000 +0100
@@ -1,2 +1,3 @@
01_previous_changes.patch
02_whrandom_gone.patch
+03_fix_call_to_ov_read.patch
Reply to: