From 13643870bf2dfa5d8b77c79eab43eb8a2be794b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 10 Feb 2015 16:44:38 +0100 Subject: [PATCH] video-scaler: Guard against (impossible) bits!=16 && bits!=8 case to fix compiler warning with clang video-scaler.c:1331:14: error: variable 'func' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] } else if (bits == 16) { ^~~~~~~~~~ video-scaler.c:1348:3: note: uninitialized use occurs here func (scale, src_lines, dest, dest_offset, width, n_elems); ^~~~ video-scaler.c:1331:10: note: remove the 'if' if its condition is always true } else if (bits == 16) { ^~~~~~~~~~~~~~~~ video-scaler.c:1260:27: note: initialize the variable 'func' to silence this warning GstVideoScalerVFunc func; ^ = NULL --- gst-libs/gst/video/video-scaler.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst-libs/gst/video/video-scaler.c b/gst-libs/gst/video/video-scaler.c index 94eb02b346..5ab05d5fca 100644 --- a/gst-libs/gst/video/video-scaler.c +++ b/gst-libs/gst/video/video-scaler.c @@ -1340,6 +1340,9 @@ gst_video_scaler_vertical (GstVideoScaler * scale, GstVideoFormat format, func = video_scale_v_ntap_u16; break; } + } else { + g_return_if_reached (); + func = NULL; } if (scale->tmpwidth < width)