GNOME Bugzilla – Bug 516989
[dvdreadsrc] wrong (negative) stream position returned due to integer overflow
Last modified: 2008-02-18 05:15:33 UTC
Please describe the problem: Querying position on a dvdreadsrc element returns a negative value once passed the INT_MAX position on Linux 32bit machine (2147483647) Steps to reproduce: (using gst-python for convenience) 1. >>> pipeline = gst.parse_launch("dvdreadsrc name=dvdread title=1 ! fakesink") 2. >>> src = pipeline.get_by_name("dvdread") 3. call src.query_position ( gst.FORMAT_BYTES ) (e.g. every second in a loop) until it starts returning negative values Actual results: example result: ... 2123337728 2136524800 -2144927744 -2131261440 ... Expected results: should have been something like:... 2123337728 2136524800 2150039550 2163705854 ... Does this happen every time? Yes Other information: adding a cast (gint64) src->cur_pack seems to solve the problem
Created attachment 105431 [details] [review] added (gint64) casts to prevent 32bit integer value overflow
Accepted, since the patch is trivially obvious.
2008-02-18 Sebastian Dröge <slomo@circular-chaos.org> Patch by: Tal Shalif <tshalif at nargila dot org> * ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_create), (gst_dvd_read_src_do_seek), (gst_dvd_read_src_do_position_query): Add some gint64 casts to prevent 32 bit integer overflows. Fixes bug #516989.