{
        int index = f->index;
 
-       if (f->index > NUM_FORMATS)
+       if (f->index >= NUM_FORMATS)
                return -EINVAL;
 
        strlcpy(f->description, formats[index].name, sizeof(f->description));
        f->fmt.pix.width &= ~0x03;
        f->fmt.pix.bytesperline =
                (f->fmt.pix.width * fmt->depth) >> 3;
+       f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline;
        f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
 
        return 0;
 {
        struct viu_fh *fh = priv;
 
-       if (i > 1)
+       if (i)
                return -EINVAL;
 
        decoder_call(fh->dev, video, s_routing, i, 0, 0);