[Bug 752052] appsrc: Initialize min and max vars in get_property() for fix compiler warnings

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Sun Dec 25 13:21:29 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=752052

Tim-Philipp Müller <t.i.m at zen.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|git master                  |1.11.1
            Summary|appsrc:  Initializing min   |appsrc: Initialize min and
                   |and max in                  |max vars in get_property()
                   |gst_app_src_get_property    |for fix compiler warnings
           Severity|normal                      |minor

--- Comment #4 from Tim-Philipp Müller <t.i.m at zen.co.uk> ---
Thanks for the bug report and the patch!

> An easy way out is to assume that GCC is just wrong and to ignore
> this bug report.  But I'd be careful assuming that...

GCC is most certainly wrong in this case, but it can't know that here. This is
a GObject vfunc, so we can be fairly sure that this really is a GstAppSrc.
IS_APP_SRC checks in get/set_property funcs don't really make sense IMHO and I
tend to remove them whenever I see them.

Since we compile with -Werror we just need to work around these false-positives
as we do in other places.


commit 57ff3ea72fd30fa900c069bb948745f3bfdff9d1
Author: Tobias Mueller <muelli at cryptobitch.de>
Date:   Thu Jul 2 07:23:23 2015 +0200

    appsrc: fix compiler warning

    Initialize min and max _get_property() to gets rid of these
    compiler warnings:

    gstappsrc.c:741:7: error: 'max' may be used uninitialized in this function
           g_value_set_int64 (value, max);
           ^
    gstappsrc.c:733:7: error: 'min' may be used uninitialized in this function
           g_value_set_int64 (value, min);
           ^
    Which happens because gcc doesn't know that GST_IS_APP_SRC will never
    fail here.

    https://bugzilla.gnome.org/show_bug.cgi?id=752052

-- 
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