The error seems to be connected with the process of setting the image dimensions. Setting V4L2_FIELD_NONE instead of V4L2_FIELD_ANY solved to crash.
struct v4l2_format fmt;
...
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = ...
fmt.fmt.pix.height = ...
fmt.fmt.pix.pixelformat = ...
fmt.fmt.pix.field = V4L2_FIELD_NONE;