mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
*: mark code that cannot support oversized POD values
This should be supported, but lots of code doesn't support it yet.
This commit is contained in:
parent
fcfe01a0be
commit
babcf6d118
5 changed files with 10 additions and 6 deletions
|
|
@ -2256,7 +2256,7 @@ static int vidioc_queryctrl(struct file *file, struct v4l2_queryctrl *arg)
|
|||
// check type and populate range
|
||||
pod = spa_pod_get_values(type, &n_vals, &choice);
|
||||
if (pod->type == SPA_TYPE_Int) {
|
||||
if (n_vals < 4)
|
||||
if (pod->size != sizeof(int) || n_vals < 4)
|
||||
break;
|
||||
arg->type = V4L2_CTRL_TYPE_INTEGER;
|
||||
int *v = SPA_POD_BODY(pod);
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ enum_filter_format(uint32_t media_type, int32_t media_subtype,
|
|||
if (index == 0)
|
||||
video_format = values[0];
|
||||
} else {
|
||||
if (index < n_values - 1)
|
||||
if (index < n_values - 1 && val->size == sizeof(values[0]))
|
||||
video_format = values[index + 1];
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1117,7 +1117,7 @@ handle_int_prop (const struct spa_pod_prop *prop, const char *key, GstCaps *res)
|
|||
case SPA_CHOICE_Range:
|
||||
case SPA_CHOICE_Step:
|
||||
{
|
||||
if (n_items < 3)
|
||||
if (n_items < 3 || val->size != sizeof(ints[0]))
|
||||
return;
|
||||
gst_caps_set_simple (res, key, GST_TYPE_INT_RANGE, ints[1], ints[2], NULL);
|
||||
break;
|
||||
|
|
@ -1225,7 +1225,7 @@ handle_fraction_prop (const struct spa_pod_prop *prop, const char *key, GstCaps
|
|||
case SPA_CHOICE_Range:
|
||||
case SPA_CHOICE_Step:
|
||||
{
|
||||
if (n_items < 3)
|
||||
if (n_items < 3 || val->size != sizeof(fract[0]))
|
||||
return;
|
||||
|
||||
if (fract[1].num == fract[2].num &&
|
||||
|
|
|
|||
|
|
@ -683,7 +683,7 @@ static int add_int(struct format_info *info, const char *k, struct spa_pod *para
|
|||
return -ENOENT;
|
||||
|
||||
val = spa_pod_get_values(&prop->value, &n_values, &choice);
|
||||
if (val->type != SPA_TYPE_Int)
|
||||
if (val->type != SPA_TYPE_Int || val->size != sizeof(values[0]))
|
||||
return -ENOTSUP;
|
||||
|
||||
if (n_values == 0)
|
||||
|
|
@ -745,7 +745,7 @@ static int format_info_iec958_from_param(struct format_info *info, struct spa_po
|
|||
return -ENOENT;
|
||||
|
||||
val = spa_pod_get_values(&prop->value, &n_values, &choice);
|
||||
if (val->type != SPA_TYPE_Id)
|
||||
if (val->type != SPA_TYPE_Id || val->size != sizeof(values[0]))
|
||||
return -ENOTSUP;
|
||||
|
||||
if (index >= n_values)
|
||||
|
|
|
|||
|
|
@ -1276,6 +1276,10 @@ static int node_event_param(void *object, int seq,
|
|||
free(c);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (n_vals > 1 && pod->size != spa_pod_type_size(pod->type)) {
|
||||
free(c);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
c->type = pod->type;
|
||||
if (spa_pod_is_float(pod))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue