forked from enlightenment/efl
fix buffer over/underflow errors with jpeg mmap load. ugh. mmap adds
pains to loading. SVN revision: 62584
This commit is contained in:
parent
352ec9086c
commit
5f365281fd
|
@ -115,19 +115,15 @@ _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
|
||||||
_evas_jpeg_membuf_src_term(j_decompress_ptr cinfo)
|
_evas_jpeg_membuf_src_term(j_decompress_ptr cinfo)
|
||||||
|
|
Loading…
Reference in New Issue