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 791140 - ximagesink, xvimagesink: fix incorrect type conversion of pointer position
ximagesink, xvimagesink: fix incorrect type conversion of pointer position
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal minor
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-02 17:20 UTC by Akinobu Mita
Modified: 2017-12-08 00:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposal patch to fix this bug (2.17 KB, patch)
2017-12-02 17:20 UTC, Akinobu Mita
committed Details | Review

Description Akinobu Mita 2017-12-02 17:20:12 UTC
Created attachment 364823 [details] [review]
proposal patch to fix this bug

I'm currently playing with modified ximagesink that does XGrabPointer()
in order to receive the mouse events occurred outside of the window and
send them to the navigation interface.

The pointer positions usually have positive coordinates, but it could
be negative with that change.

When the ximagesink handles XEvent that contains a negative pointer
coordinate, it incorrectly generates the GstEvent that contains an
extremely large positive pointer coordinate.

This is because the negative pointer position in XEvent is incorrectly
converted from signed to unsigned and passed as an argument to
gst_navigation_send_mouse_event() which causes implicit conversion from
integer to double.  So the pointer position in the received XEvent and
generated GstEvent are completely different.

This potential problem does not seem to be a real problem with unmodified
ximagesink but there is no reason to leave it as is.  This also fixes
xvimagesink that has the same potential problem.
Comment 1 Tim-Philipp Müller 2017-12-08 00:51:08 UTC
Why not, I guess:

commit 6e770e0ebbc9b36fa06a9a3a7b485ee1e8ea97e5
Author: Akinobu Mita <akinobu.mita@gmail.com>
Date:   Sun Dec 3 02:10:40 2017 +0900

    ximagesink, xvimagesink: fix incorrect type conversion of pointer position
    
    I'm currently playing with modified ximagesink that does XGrabPointer()
    in order to receive the mouse events occurred outside of the window and
    send them to the navigation interface.
    
    The pointer positions usually have positive coordinates, but it could
    be negative with that change.
    
    When the ximagesink handles XEvent that contains a negative pointer
    coordinate, it incorrectly generates the GstEvent that contains an
    extremely large positive pointer coordinate.
    
    This is because the negative pointer position in XEvent is incorrectly
    converted from signed to unsigned and passed as an argument to
    gst_navigation_send_mouse_event() which causes implicit conversion from
    integer to double.  So the pointer position in the received XEvent and
    generated GstEvent are completely different.
    
    This potential problem does not seem to be a real problem with unmodified
    ximagesink but there is no reason to leave it as is.  This also fixes
    xvimagesink that has the same potential problem.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791140