mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
libs: filter: fail if first color balance value is invalid
This commit is contained in:
parent
a48625d7ff
commit
d060582798
1 changed files with 6 additions and 4 deletions
|
@ -864,6 +864,7 @@ op_set_color_balance_unlocked (GstVaapiFilter * filter,
|
||||||
gint i;
|
gint i;
|
||||||
GstVaapiFilterOpData *color_data[COLOR_BALANCE_NUM];
|
GstVaapiFilterOpData *color_data[COLOR_BALANCE_NUM];
|
||||||
GstVaapiFilterOpData *enabled_data = NULL;
|
GstVaapiFilterOpData *enabled_data = NULL;
|
||||||
|
gboolean ret = TRUE;
|
||||||
|
|
||||||
if (!op_data)
|
if (!op_data)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -907,9 +908,10 @@ op_set_color_balance_unlocked (GstVaapiFilter * filter,
|
||||||
va_value = G_PARAM_SPEC_FLOAT (color_data[i]->pspec)->default_value;
|
va_value = G_PARAM_SPEC_FLOAT (color_data[i]->pspec)->default_value;
|
||||||
if (color_data[i]->op == op_data->op) {
|
if (color_data[i]->op == op_data->op) {
|
||||||
filter_cap = color_data[i]->va_caps;
|
filter_cap = color_data[i]->va_caps;
|
||||||
/* don't fail, just ignore current value and set default one */
|
/* fail but ignore current value and set default one */
|
||||||
op_data_get_value_float (color_data[i], &filter_cap->range, value,
|
if (!op_data_get_value_float (color_data[i], &filter_cap->range, value,
|
||||||
&va_value);
|
&va_value))
|
||||||
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf[i].value = va_value;
|
buf[i].value = va_value;
|
||||||
|
@ -936,7 +938,7 @@ op_set_color_balance_unlocked (GstVaapiFilter * filter,
|
||||||
|
|
||||||
vaapi_unmap_buffer (filter->va_display, enabled_data->va_buffer, NULL);
|
vaapi_unmap_buffer (filter->va_display, enabled_data->va_buffer, NULL);
|
||||||
|
|
||||||
return TRUE;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
|
|
Loading…
Reference in a new issue