diff options
author | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2011-05-24 15:15:15 +0000 |
---|---|---|
committer | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2011-05-24 15:15:15 +0000 |
commit | 582cefc2354ea9c206bc80887533fed36770b2a2 (patch) | |
tree | 47216f3394af33607f415c759ea9141d3dde8a44 /jdatadst-tj.c | |
parent | 67f0abcc48ded41d5ba46d96a675e3eed9d0cb4d (diff) |
Fix memory leak in new TurboJPEG auto-reallocation mode
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@633 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'jdatadst-tj.c')
-rw-r--r-- | jdatadst-tj.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/jdatadst-tj.c b/jdatadst-tj.c index 3816f95..cb674dc 100644 --- a/jdatadst-tj.c +++ b/jdatadst-tj.c @@ -160,6 +160,8 @@ jpeg_mem_dest_tj (j_compress_ptr cinfo, cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_mem_destination_mgr)); + dest = (my_mem_dest_ptr) cinfo->dest; + dest->newbuffer = NULL; } dest = (my_mem_dest_ptr) cinfo->dest; @@ -168,7 +170,6 @@ jpeg_mem_dest_tj (j_compress_ptr cinfo, dest->pub.term_destination = term_mem_destination; dest->outbuffer = outbuffer; dest->outsize = outsize; - dest->newbuffer = NULL; dest->alloc = alloc; if (*outbuffer == NULL || *outsize == 0) { |