From b4a129ad71a1752b81365fa776673337c77df7ca Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 20 May 2014 08:23:06 +0200 Subject: [PATCH] vp8enc: Don't dereference NULL variable CID #1139838 --- ext/vpx/gstvp8enc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/vpx/gstvp8enc.c b/ext/vpx/gstvp8enc.c index 0271ffc..c1c0a07 100644 --- a/ext/vpx/gstvp8enc.c +++ b/ext/vpx/gstvp8enc.c @@ -932,18 +932,18 @@ gst_vp8_enc_set_property (GObject * object, guint prop_id, memset (&gst_vp8_enc->cfg.ts_rate_decimator, 0, sizeof (gst_vp8_enc->cfg.ts_rate_decimator)); - if (va->n_values > VPX_TS_MAX_LAYERS) { + if (va == NULL) { + gst_vp8_enc->n_ts_rate_decimator = 0; + } else if (va->n_values > VPX_TS_MAX_LAYERS) { g_warning ("%s: Only %d layers allowed at maximum", GST_ELEMENT_NAME (gst_vp8_enc), VPX_TS_MAX_LAYERS); - } else if (va) { + } else { gint i; for (i = 0; i < va->n_values; i++) gst_vp8_enc->cfg.ts_rate_decimator[i] = g_value_get_int (g_value_array_get_nth (va, i)); gst_vp8_enc->n_ts_rate_decimator = va->n_values; - } else { - gst_vp8_enc->n_ts_rate_decimator = 0; } global = TRUE; break; -- 2.7.4