Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
continue;
switch (data[i + 1]) {
case 0xd9: /* end of frame */
+ i += 2;
frame = gspca_frame_add(gspca_dev,
LAST_PACKET,
- frame, data, i + 1);
- data += INTER_FRAME;
- len -= INTER_FRAME;
+ frame, data, i);
+ data += i + INTER_FRAME;
+ len -= i + INTER_FRAME;
i = 0;
- if (len > LUM_OFFSET)
+ if (len > -LUM_OFFSET)
sd->lum_sum += data[-LUM_OFFSET];
if (len < 0) {
sd->tosof = -len;