Commit 3c835b43 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

v4l2: fail on unknowm/unitialized format (fixes #8086)

This bug is already fixed differently in the main line.
parent ecd6e2e9
......@@ -1265,7 +1265,12 @@ static int InitVideo( vlc_object_t *p_obj, int i_fd, demux_sys_t *p_sys,
width = fmt.fmt.pix.width;
height = fmt.fmt.pix.height;
if( v4l2_ioctl( i_fd, VIDIOC_G_FMT, &fmt ) < 0 ) {;}
if( v4l2_ioctl( i_fd, VIDIOC_G_FMT, &fmt ) < 0 )
{
msg_Err( p_obj, "Could not get selected video format: %m" );
goto error;
}
/* Print extra info */
msg_Dbg( p_obj, "Driver requires at most %d bytes to store a complete image", fmt.fmt.pix.sizeimage );
/* Check interlacing */
......@@ -1325,6 +1330,11 @@ static int InitVideo( vlc_object_t *p_obj, int i_fd, demux_sys_t *p_sys,
break;
}
}
if( !p_sys->i_fourcc )
{
msg_Err( p_obj, "Could not match pixel format" );
goto error;
}
/* Buggy driver paranoia */
i_min = fmt.fmt.pix.width * 2;
......
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