After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 516989 - [dvdreadsrc] wrong (negative) stream position returned due to integer overflow
[dvdreadsrc] wrong (negative) stream position returned due to integer overflow
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other All
: Normal blocker
: 0.10.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-17 13:03 UTC by Tal Shalif
Modified: 2008-02-18 05:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
added (gint64) casts to prevent 32bit integer value overflow (1.27 KB, patch)
2008-02-17 13:09 UTC, Tal Shalif
committed Details | Review

Description Tal Shalif 2008-02-17 13:03:29 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
Comment 1 Tal Shalif 2008-02-17 13:09:21 UTC
Created attachment 105431 [details] [review]
added (gint64) casts to prevent 32bit integer value overflow
Comment 2 Jan Schmidt 2008-02-17 18:40:52 UTC
Accepted, since the patch is trivially obvious.
Comment 3 Sebastian Dröge (slomo) 2008-02-18 05:15:33 UTC
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.