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
This commit is contained in:
Sebastian Dröge 2015-02-10 16:44:38 +01:00
parent b680671374
commit 13643870bf

View file

@ -1340,6 +1340,9 @@ gst_video_scaler_vertical (GstVideoScaler * scale, GstVideoFormat format,
func = video_scale_v_ntap_u16; func = video_scale_v_ntap_u16;
break; break;
} }
} else {
g_return_if_reached ();
func = NULL;
} }
if (scale->tmpwidth < width) if (scale->tmpwidth < width)