• Mauro Carvalho Chehab's avatar
    media: vim2m: better handle cap/out buffers with different sizes · 24cc418b
    Mauro Carvalho Chehab authored
    The vim2m driver doesn't enforce that the capture and output
    buffers would have the same size. Do the right thing if the
    buffers are different, zeroing the buffer before writing,
    ensuring that lines will be aligned and it won't write past
    the buffer area.
    
    This is a temporary fix.
    
    A proper fix is to either implement a simple scaler at vim2m,
    or to better define the behaviour of M2M transform drivers
    at V4L2 API with regards to its capability of scaling the
    image or not.
    
    In any case, such changes would deserve a separate patch
    anyway, as it would imply on some behavoral change.
    
    Also, as we have an actual bug of writing data at wrong
    places, let's fix this here, and add a mental note that
    we need to properly address it.
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
    24cc418b
vim2m.c 34 KB