Commit 5263f91e authored by Edward Hervey's avatar Edward Hervey

vp9enc: Don't dereference NULL checks

CID #1197703
parent 32d8eb9f
......@@ -886,18 +886,20 @@ gst_vp9_enc_set_property (GObject * object, guint prop_id,
memset (&gst_vp9_enc->cfg.ts_target_bitrate, 0,
sizeof (gst_vp9_enc->cfg.ts_target_bitrate));
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) {
gint i;
for (i = 0; i < va->n_values; i++)
gst_vp9_enc->cfg.ts_target_bitrate[i] =
g_value_get_int (g_value_array_get_nth (va, i));
gst_vp9_enc->n_ts_target_bitrate = va->n_values;
} else {
if (va == NULL) {
gst_vp9_enc->n_ts_target_bitrate = 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 {
gint i;
for (i = 0; i < va->n_values; i++)
gst_vp9_enc->cfg.ts_target_bitrate[i] =
g_value_get_int (g_value_array_get_nth (va, i));
gst_vp9_enc->n_ts_target_bitrate = va->n_values;
}
}
global = TRUE;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment