Upstream patch for YT-GD-538 Pulled from: http://sourceforge.net/p/zbar/code/ci/825b6ec9244619cc616d592e657fc64b5d7b2c25/tree/zbar/jpeg.c?diff=0e183788061038ad5a32543e594ebe48bde89971 --- a/zbar/jpeg.c +++ b/zbar/jpeg.c @@ -79,8 +79,15 @@ void skip_input_data (j_decompress_ptr cinfo, long num_bytes) { - cinfo->src->next_input_byte = NULL; - cinfo->src->bytes_in_buffer = 0; + if(num_bytes > 0) { + if (num_bytes < cinfo->src->bytes_in_buffer) { + cinfo->src->next_input_byte += num_bytes; + cinfo->src->bytes_in_buffer -= num_bytes; + } + else { + fill_input_buffer(cinfo); + } + } } void term_source (j_decompress_ptr cinfo)