From: <co...@fr...> - 2005-04-26 22:24:22
|
CVS Root: /cvs/gstreamer Module: gst-python Changes by: company Date: Wed Apr 27 2005 08:24:20 EST Branch: BRANCH-GSTREAMER-0_8 Log message: * gst/gstbuffer.override: throw TypeError if bufsize < data size. Fixes testsuite Modified files: . : ChangeLog gst : gstbuffer.override Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/ChangeLog.diff?r1=1.157.2.8&r2=1.157.2.9 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/gst/gstbuffer.override.diff?r1=1.4.2.1&r2=1.4.2.2 ====Begin Diffs==== Index: gstbuffer.override =================================================================== RCS file: /cvs/gstreamer/gst-python/gst/gstbuffer.override,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -d -r1.4.2.1 -r1.4.2.2 --- gstbuffer.override 26 Apr 2005 20:10:38 -0000 1.4.2.1 +++ gstbuffer.override 26 Apr 2005 22:24:07 -0000 1.4.2.2 @@ -53,10 +53,16 @@ PyErr_SetString(PyExc_TypeError, "buffer size must be >= 0"); return -1; } + if (buf_size < 0) + buf_size = size; + if (buf_size < size) { + PyErr_SetString(PyExc_TypeError, "buffer size must be >= data size"); + return -1; + } self->gtype = GST_TYPE_BUFFER; self->free_on_dealloc = FALSE; - self->boxed = gst_buffer_new_and_alloc(buf_size > size ? buf_size : size); + self->boxed = gst_buffer_new_and_alloc(buf_size); if (!self->boxed) { PyErr_SetString(PyExc_RuntimeError, "could not create GstBuffer object"); Index: ChangeLog RCS file: /cvs/gstreamer/gst-python/ChangeLog,v retrieving revision 1.157.2.8 retrieving revision 1.157.2.9 diff -u -d -r1.157.2.8 -r1.157.2.9 --- ChangeLog 26 Apr 2005 22:21:12 -0000 1.157.2.8 +++ ChangeLog 26 Apr 2005 22:24:07 -0000 1.157.2.9 @@ -1,3 +1,8 @@ +2005-04-27 Benjamin Otte <in...@pu...> + + * gst/gstbuffer.override: + throw TypeError if bufsize < data size. Fixes testsuite 2005-04-26 Johan Dahlin <jd...@as...> * testsuite/runtests.py: Return exit code 1 if we have any failures |