GstVideoScaler: Initialised scaling functions to get rid of compiler messages
authorTobias Mueller <muelli@cryptobitch.de>
Thu, 2 Jul 2015 05:36:12 +0000 (07:36 +0200)
committerWim Taymans <wtaymans@redhat.com>
Tue, 7 Jul 2015 11:06:34 +0000 (13:06 +0200)
commit190c7f19288bc28a6a0428367ae108bebddaf43d
tree191e84315c085547e16e4da10acb1cb6a5ad93a1
parent51019c16e16d1860491840774b2521173440349e
GstVideoScaler: Initialised scaling functions to get rid of compiler messages

E.g.

video-scaler.c: In function 'gst_video_scaler_horizontal':
video-scaler.c:1332:3: error: 'func' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   func (scale, src, dest, dest_offset, width, n_elems);
   ^

video-scaler.c: In function 'gst_video_scaler_vertical':
video-scaler.c:1373:3: error: 'func' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   func (scale, src_lines, dest, dest_offset, width, n_elems);
   ^

GCC's analyses seem to be correct, for the simple fact that if you pass
get_functions a known format, but no hscale or vscale, it'll return
True without having done anything.
Some callers check for the scale values to be not NULL, but then
hscale->resampler.max_taps could return 0.
A different approach to the one presented in this patch is to check
for those max_taps, too, before calling get_functions.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=752051
gst-libs/gst/video/video-scaler.c