[MPlayer-dev-eng] [PATCH 2/5] stream_pvr: validate extended v4l2 controls before setting them

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Feb 7 18:22:55 CET 2016


On Tue, Feb 02, 2016 at 11:21:34AM -0600, Reza Arbab wrote:
> @@ -1021,6 +1021,35 @@ static void
>  add_v4l2_ext_control (struct v4l2_ext_controls *ctrls, struct pvr_t *pvr,
>                        uint32_t id, int32_t value)
>  {
> +  struct v4l2_query_ext_ctrl qctrl;
> +  struct v4l2_querymenu qmenu;
> +
> +  qctrl.id = id;

Please move the qmenu declaration into the block that uses it.
Also I'd prefer if the whole struct gets initialized,
so it would be better to use designated intializers:
struct v4l2_query_ext_ctrl qctrl = { .id = id; };
(something like that, been stuck in C++ land too long
that lacks this feature)
I see a small concern that it might break some drivers
that simply don't implement the query (correctly).
So maybe at least put the messages at MSGL_V?


More information about the MPlayer-dev-eng mailing list