diff options
Diffstat (limited to 'homebrew/zbar/patches.sh')
-rwxr-xr-x | homebrew/zbar/patches.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/homebrew/zbar/patches.sh b/homebrew/zbar/patches.sh new file mode 100755 index 000000000..663c4ee40 --- /dev/null +++ b/homebrew/zbar/patches.sh @@ -0,0 +1,25 @@ +echo 'Creating brew-patch.diff' +cat << EOF >> brew-patch.diff +diff --git a/zbar/jpeg.c b/zbar/jpeg.c +index fb566f4..d1c1fb2 100644 +--- a/zbar/jpeg.c ++++ b/zbar/jpeg.c +@@ -79,8 +79,15 @@ int fill_input_buffer (j_decompress_ptr cinfo) + 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) +EOF |