summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/vc032x.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-12-26 08:41:17 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-01-17 11:31:36 -0200
commit9501843496aaf85fe1767b534c4720622c4425c4 (patch)
treeabf8f276dd2561fadd9358906256230d266b57eb /drivers/media/video/gspca/vc032x.c
parentc60503c1db76bd46577cc7ff4fafa033b675e0e5 (diff)
downloadblackbird-op-linux-9501843496aaf85fe1767b534c4720622c4425c4.tar.gz
blackbird-op-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>
Diffstat (limited to 'drivers/media/video/gspca/vc032x.c')
-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;
OpenPOWER on IntegriCloud