gtf: Initialize variables which might not get initialized

If the gtf options contain a bad enum di_gtf_ip_param, some variables do
not get initialized to any value but will later be read.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
This commit is contained in:
Sebastian Wick 2024-07-29 14:37:23 +02:00
parent 9cc806c512
commit 8d04de834a

9
gtf.c
View file

@ -37,12 +37,11 @@
void di_gtf_compute(struct di_gtf_timing *t, const struct di_gtf_options *options)
{
double c_prime, m_prime, h_pixels_rnd, v_lines_rnd, h_margin,
v_margin, interlace, total_active_pixels, pixel_freq,
h_blank_pixels, total_pixels, v_sync_bp, v_field_rate_rqd,
h_period_est, total_v_lines, v_field_rate_est, h_period,
ideal_duty_cycle, h_freq, ideal_h_period, v_back_porch, h_sync,
double c_prime, m_prime, h_pixels_rnd, v_lines_rnd, h_margin, v_margin, interlace,
total_active_pixels, v_field_rate_rqd, h_period_est, total_v_lines, v_field_rate_est,
h_period, ideal_duty_cycle, h_freq, ideal_h_period, v_back_porch, h_sync,
h_front_porch;
double v_sync_bp = 0.0, h_blank_pixels = 0.0, total_pixels = 0.0, pixel_freq = 0.0;
/* C' and M' are part of the Blanking Duty Cycle computation */
c_prime = ((options->c - options->j) * options->k / 256.0) + options->j;