projects
/
geeqie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10f4b60
)
fixed crash on incomplete jpeg file
author
Vladimir Nadvornik
<nadvornik@suse.cz>
Fri, 29 Jul 2011 13:27:09 +0000
(15:27 +0200)
committer
Vladimir Nadvornik
<nadvornik@suse.cz>
Tue, 27 Sep 2011 12:30:09 +0000
(14:30 +0200)
src/image_load_jpeg.c
patch
|
blob
|
history
diff --git
a/src/image_load_jpeg.c
b/src/image_load_jpeg.c
index
6e9877a
..
b1a4098
100644
(file)
--- a/
src/image_load_jpeg.c
+++ b/
src/image_load_jpeg.c
@@
-234,7
+234,11
@@
static void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
{
struct jpeg_source_mgr* src = (struct jpeg_source_mgr*) cinfo->src;
- if (num_bytes > 0)
+ if (num_bytes > src->bytes_in_buffer)
+ {
+ ERREXIT(cinfo, JERR_INPUT_EOF);
+ }
+ else if (num_bytes > 0)
{
src->next_input_byte += (size_t) num_bytes;
src->bytes_in_buffer -= (size_t) num_bytes;