Skip to content

Commit

Permalink
V4L/DVB (13875): gspca - vc032x: Fix a possible crash with the vc0321…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Jean-Francois Moine authored and Mauro Carvalho Chehab committed Jan 17, 2010
1 parent c60503c commit 9501843
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/video/gspca/vc032x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9501843

Please sign in to comment.