diff options
Diffstat (limited to 'drivers/media/video/gspca/vc032x.c')
-rw-r--r-- | drivers/media/video/gspca/vc032x.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c index 589042f6adbe..c090efcd8045 100644 --- a/drivers/media/video/gspca/vc032x.c +++ b/drivers/media/video/gspca/vc032x.c | |||
@@ -2987,7 +2987,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
2987 | } | 2987 | } |
2988 | 2988 | ||
2989 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 2989 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
2990 | struct gspca_frame *frame, /* target */ | ||
2991 | u8 *data, /* isoc packet */ | 2990 | u8 *data, /* isoc packet */ |
2992 | int len) /* iso pkt length */ | 2991 | int len) /* iso pkt length */ |
2993 | { | 2992 | { |
@@ -2996,21 +2995,25 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
2996 | if (data[0] == 0xff && data[1] == 0xd8) { | 2995 | if (data[0] == 0xff && data[1] == 0xd8) { |
2997 | PDEBUG(D_PACK, | 2996 | PDEBUG(D_PACK, |
2998 | "vc032x header packet found len %d", len); | 2997 | "vc032x header packet found len %d", len); |
2999 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, | 2998 | gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0); |
3000 | data, 0); | ||
3001 | data += sd->image_offset; | 2999 | data += sd->image_offset; |
3002 | len -= sd->image_offset; | 3000 | len -= sd->image_offset; |
3003 | gspca_frame_add(gspca_dev, FIRST_PACKET, frame, | 3001 | gspca_frame_add(gspca_dev, FIRST_PACKET, data, len); |
3004 | data, len); | ||
3005 | return; | 3002 | return; |
3006 | } | 3003 | } |
3007 | 3004 | ||
3008 | /* The vc0321 sends some additional data after sending the complete | 3005 | /* The vc0321 sends some additional data after sending the complete |
3009 | * frame, we ignore this. */ | 3006 | * frame, we ignore this. */ |
3010 | if (sd->bridge == BRIDGE_VC0321 | 3007 | if (sd->bridge == BRIDGE_VC0321) { |
3011 | && len > frame->v4l2_buf.length - (frame->data_end - frame->data)) | 3008 | struct gspca_frame *frame; |
3012 | len = frame->v4l2_buf.length - (frame->data_end - frame->data); | 3009 | int l; |
3013 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); | 3010 | |
3011 | frame = gspca_get_i_frame(gspca_dev); | ||
3012 | l = frame->data_end - frame->data; | ||
3013 | if (len > frame->v4l2_buf.length - l) | ||
3014 | len = frame->v4l2_buf.length - l; | ||
3015 | } | ||
3016 | gspca_frame_add(gspca_dev, INTER_PACKET, data, len); | ||
3014 | } | 3017 | } |
3015 | 3018 | ||
3016 | static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val) | 3019 | static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val) |
@@ -3092,6 +3095,8 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, | |||
3092 | 3095 | ||
3093 | switch (menu->id) { | 3096 | switch (menu->id) { |
3094 | case V4L2_CID_POWER_LINE_FREQUENCY: | 3097 | case V4L2_CID_POWER_LINE_FREQUENCY: |
3098 | if (menu->index >= ARRAY_SIZE(freq_nm)) | ||
3099 | break; | ||
3095 | strcpy((char *) menu->name, freq_nm[menu->index]); | 3100 | strcpy((char *) menu->name, freq_nm[menu->index]); |
3096 | return 0; | 3101 | return 0; |
3097 | } | 3102 | } |