diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-12-26 06:41:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-01-17 08:31:36 -0500 |
commit | 9501843496aaf85fe1767b534c4720622c4425c4 (patch) | |
tree | abf8f276dd2561fadd9358906256230d266b57eb /drivers/media/video | |
parent | c60503c1db76bd46577cc7ff4fafa033b675e0e5 (diff) |
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')
-rw-r--r-- | drivers/media/video/gspca/vc032x.c | 4 |
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, | |||
3009 | int l; | 3009 | int l; |
3010 | 3010 | ||
3011 | frame = gspca_get_i_frame(gspca_dev); | 3011 | frame = gspca_get_i_frame(gspca_dev); |
3012 | if (frame == NULL) { | ||
3013 | gspca_dev->last_packet_type = DISCARD_PACKET; | ||
3014 | return; | ||
3015 | } | ||
3012 | l = frame->data_end - frame->data; | 3016 | l = frame->data_end - frame->data; |
3013 | if (len > frame->v4l2_buf.length - l) | 3017 | if (len > frame->v4l2_buf.length - l) |
3014 | len = frame->v4l2_buf.length - l; | 3018 | len = frame->v4l2_buf.length - l; |