Some code in jchuff.c and jdhuff.c does not keep next_input_byte and bytes_in_buffer up to date in the source structure. This is not a problem for the read/write implementations provided with libjpeg which seem to assume buffers are always completely consumed, but it is a problem with some implementations of the read/write code that need to deal with libjpeg versions (ie. IPP) that do not always completely consume input.
The fixes are at:
http://trac.osgeo.org/gdal/changeset/15507
http://trac.osgeo.org/gdal/changeset/16363
Anonymous