[zbar-commits] push rev [290]: fix jpeg decoder skip handling
Status: Beta
Brought to you by:
spadix
|
From: <sp...@us...> - 2011-01-17 01:06:47
|
changeset: 290:825b6ec92446 user: sp...@us... date: Sun Jan 16 17:05:29 2011 -0800 details: http://zbar.hg.sourceforge.net:8000/hgroot/zbar/zbarzbar/rev/825b6ec92446 description: fix jpeg decoder skip handling - thanks to jarekczek for the patch! diffstat: ChangeLog | 2 ++ zbar/jpeg.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diffs (31 lines): diff -r 0e1837880610 -r 825b6ec92446 ChangeLog --- a/ChangeLog Sun Jan 16 14:48:39 2011 -0800 +++ b/ChangeLog Sun Jan 16 17:05:29 2011 -0800 @@ -1,4 +1,6 @@ current: + * fix jpeg decoder skip handling + - thanks to jarekczek for the patch! * rename dprintf macro to avoid conflicts (patch #3128538) - thanks to maurochehab for the patch! * add support for EAN/UPC 2 and 5 digit add-on symbols diff -r 0e1837880610 -r 825b6ec92446 zbar/jpeg.c --- a/zbar/jpeg.c Sun Jan 16 14:48:39 2011 -0800 +++ b/zbar/jpeg.c Sun Jan 16 17:05:29 2011 -0800 @@ -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) |