fix buffer over/underflow errors with jpeg mmap load. ugh. mmap adds

pains to loading.



SVN revision: 62584
This commit is contained in:
Carsten Haitzler 2011-08-19 06:58:33 +00:00
parent 352ec9086c
commit 5f365281fd
1 changed files with 6 additions and 10 deletions

View File

@ -115,18 +115,14 @@ _evas_jpeg_membuf_src_skip(j_decompress_ptr cinfo,
{ {
struct jpeg_membuf_src *src = (struct jpeg_membuf_src *)cinfo->src; struct jpeg_membuf_src *src = (struct jpeg_membuf_src *)cinfo->src;
long rec = 0; if ((((long)src->pub.bytes_in_buffer - (long)src->len) > num_bytes) ||
rec = src->pub.bytes_in_buffer - num_bytes; ((long)src->pub.bytes_in_buffer < num_bytes))
if (rec <0)
{ {
(*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)); (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo));
return;
} }
else
{
src->pub.bytes_in_buffer -= num_bytes; src->pub.bytes_in_buffer -= num_bytes;
src->pub.next_input_byte += num_bytes; src->pub.next_input_byte += num_bytes;
}
} }
static void static void