[media] Guard a divide in v4l1 compat layer
authorDr. David Alan Gilbert <linux@treblig.org>
Sun, 24 Oct 2010 16:33:09 +0000 (13:33 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 25 Oct 2010 20:53:44 +0000 (18:53 -0200)
commit910f5f05f99c1ffbb484c4e6eb2a460e7a08e2d7
tree51bafcd6627b43233ce0896ecae489b8a19ee00a
parent52fae5eead706cb8d604ee634162f6694d75ccad
[media] Guard a divide in v4l1 compat layer

Hi,
  I managed to trigger a divide by 0 in the v4l compat code
with the mem2mem test module; I suspect perhaps it shouldn't
have been returning a 0 pixel wide picture, but either way it seems
right to guard this divide by 0 in the compatibility layer.

Tested on 2.6.36 (ubuntu build, but the code in this is the same as upstream),
but ***not tested with a real video device***.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
cc: stable.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/v4l1-compat.c