Message ID | 4B6751F3.3040407@freemail.hu (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
diff -r f23c5a878fb1 v4l2-apps/libv4l/libv4lconvert/tinyjpeg.c --- a/v4l2-apps/libv4l/libv4lconvert/tinyjpeg.c Mon Feb 01 13:32:46 2010 +0100 +++ b/v4l2-apps/libv4l/libv4lconvert/tinyjpeg.c Mon Feb 01 23:05:39 2010 +0100 @@ -339,10 +339,15 @@ } \ break; \ case 0xff: \ - if (stream[1] == 0xff && (stream[2] < 7 || stream[2] == 0xff)) { \ - stream += 3; \ - c = *stream++; \ - break; \ + if (stream[1] == 0xff) { \ + if (stream[2] < 7) { \ + stream += 3; \ + c = *stream++; \ + break; \ + } else if (stream[2] == 0xff) { \ + /* four 0xff in a row: the first belongs to the image data */ \ + break; \ + }\ } \ /* Error fall through */ \ default: \