From: Jean-Francois Moine Date: Sat, 26 Dec 2009 11:41:17 +0000 (-0300) Subject: V4L/DVB (13875): gspca - vc032x: Fix a possible crash with the vc0321 bridge. X-Git-Tag: v2.6.33-rc5~24^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9501843496aaf85fe1767b534c4720622c4425c4;p=platform%2Fkernel%2Flinux-stable.git 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c index c090efc..71921c8 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;