summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-12-26 12:41:17 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-01-17 14:31:36 +0100
commit9501843496aaf85fe1767b534c4720622c4425c4 (patch)
treeabf8f276dd2561fadd9358906256230d266b57eb
parentV4L/DVB (13868): gspca - sn9c20x: Fix test of unsigned. (diff)
downloadlinux-9501843496aaf85fe1767b534c4720622c4425c4.tar.xz
linux-9501843496aaf85fe1767b534c4720622c4425c4.zip
V4L/DVB (13875): gspca - vc032x: Fix a possible crash with the vc0321 bridge.
The frame pointer returned by get_i_frame may be NULL when the application is too slow. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/gspca/vc032x.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c
index c090efcd8045..71921c878424 100644
--- a/drivers/media/video/gspca/vc032x.c
+++ b/drivers/media/video/gspca/vc032x.c
@@ -3009,6 +3009,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
int l;
frame = gspca_get_i_frame(gspca_dev);
+ if (frame == NULL) {
+ gspca_dev->last_packet_type = DISCARD_PACKET;
+ return;
+ }
l = frame->data_end - frame->data;
if (len > frame->v4l2_buf.length - l)
len = frame->v4l2_buf.length - l;