aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2014-08-21 22:15:19 +0000
committerdcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2014-08-21 22:15:19 +0000
commit32660483368f2a29e42342d6218afb7544348776 (patch)
tree52401af11df89e493e53a67bac5214a0ecb6e2bb
parent026eb25ae45007959a92c27920be8b62fa1cc768 (diff)
Subtle point, but dest->outbuffer is a pointer to the address of the JPEG buffer, which is stored in the calling program. Thus, *(dest->outbuffer) will always equal *outbuffer. We need to compare *outbuffer with dest->buffer instead to determine if the pointer is being reused.
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1369 632fc199-4ca6-4c93-a231-07263d6284db
-rw-r--r--jdatadst-tj.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/jdatadst-tj.c b/jdatadst-tj.c
index 8289d3a..a0e0f2e 100644
--- a/jdatadst-tj.c
+++ b/jdatadst-tj.c
@@ -165,15 +165,14 @@ jpeg_mem_dest_tj (j_compress_ptr cinfo,
sizeof(my_mem_destination_mgr));
dest = (my_mem_dest_ptr) cinfo->dest;
dest->newbuffer = NULL;
- dest->outbuffer = NULL;
+ dest->buffer = NULL;
}
dest = (my_mem_dest_ptr) cinfo->dest;
dest->pub.init_destination = init_mem_destination;
dest->pub.empty_output_buffer = empty_mem_output_buffer;
dest->pub.term_destination = term_mem_destination;
- if (dest->outbuffer && *(dest->outbuffer) == *outbuffer &&
- *outbuffer != NULL && alloc)
+ if (dest->buffer == *outbuffer && *outbuffer != NULL && alloc) {
reused = TRUE;
dest->outbuffer = outbuffer;
dest->outsize = outsize;