Created
May 28, 2013 01:17
-
-
Save willglynn/5659946 to your computer and use it in GitHub Desktop.
zbar JPEG fix from http://sourceforge.net/p/zbar/code/ci/825b6ec9244619cc616d592e657fc64b5d7b2c25/tree/zbar/jpeg.c?diff=0e183788061038ad5a32543e594ebe48bde89971
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This patch was submitted to the following repos: