From eb30edae9f87c58b1cb72a72a5acc7545dd79d5d Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 20 May 2014 08:20:42 +0200 Subject: [PATCH] vp9enc: Don't dereference NULL checks CID #1197703 --- ext/vpx/gstvp9enc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/vpx/gstvp9enc.c b/ext/vpx/gstvp9enc.c index 1b15311877..9bf5efb6e7 100644 --- a/ext/vpx/gstvp9enc.c +++ b/ext/vpx/gstvp9enc.c @@ -909,18 +909,18 @@ gst_vp9_enc_set_property (GObject * object, guint prop_id, memset (&gst_vp9_enc->cfg.ts_rate_decimator, 0, sizeof (gst_vp9_enc->cfg.ts_rate_decimator)); - if (va->n_values > VPX_TS_MAX_LAYERS) { + if (va == NULL) { + gst_vp9_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_vp9_enc), VPX_TS_MAX_LAYERS); - } else if (va) { + } else { gint i; for (i = 0; i < va->n_values; i++) gst_vp9_enc->cfg.ts_rate_decimator[i] = g_value_get_int (g_value_array_get_nth (va, i)); gst_vp9_enc->n_ts_rate_decimator = va->n_values; - } else { - gst_vp9_enc->n_ts_rate_decimator = 0; } global = TRUE; break;