Skip to content

Instantly share code, notes, and snippets.

@willglynn
Created May 28, 2013 01:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willglynn/5659946 to your computer and use it in GitHub Desktop.
Save willglynn/5659946 to your computer and use it in GitHub Desktop.
--- 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)
@willglynn
Copy link
Author

This patch was submitted to the following repos:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment