[Bug 705630] New: Wrong behaviour of control bindings with properties that span +-INT_MAX

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Aug 7 10:33:18 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=705630
  GStreamer | gstreamer (core) | git

           Summary: Wrong behaviour of control bindings with properties
                    that span +-INT_MAX
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: bugzilla at tangopardo.com.ar
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Created an attachment (id=251096)
 View: https://bugzilla.gnome.org/attachment.cgi?id=251096
 Review: https://bugzilla.gnome.org/review?bug=705630&attachment=251096

Rewrite value calculation expression to avoid integer overflow.

Hello all,

I'm trying to animate the xpos and ypos of a videomixer pad but they are always
mapped from [0,1] to either -2147483648 or 2147483647 and nothing in between.

I've chased it to the macro definitions of convert_g_value_to_##type and
convert_value_to_##type in gstdirectcontrolbinding.c where the expression

v = pspec->minimum + (g##type) ROUNDING_OP ((pspec->maximum - pspec->minimum) *
s);

results in:

v = -2147483648 + (g##type) ROUNDING_OP ((-1) * s);

because 2147483647 - (-2147483648) overflows to -1;


Rewriting the expression as:

v = minimum*(1-s) + maximum*s

works but I don't know for sure if it introduces numerical stability issues in
upper layers. At least for my current use case it works fine.

The proposed patch implements that.

Discussion thread at:
http://lists.freedesktop.org/archives/gstreamer-devel/2013-August/042395.html

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list