diff options
author | DRC <dcommander@users.sourceforge.net> | 2015-07-01 16:56:44 +0000 |
---|---|---|
committer | Matt Sarett <msarett@google.com> | 2015-11-23 17:21:32 -0500 |
commit | fc235cfdabbcd1c915fa3a87a56d73727da2eaeb (patch) | |
tree | d3dd4404b71e44c3c01f78195d7d5e6cc8c9d557 | |
parent | 9bafc6a7ffa62ed7109314cbb66085075cd1c334 (diff) | |
download | libjpeg-turbo-fc235cfdabbcd1c915fa3a87a56d73727da2eaeb.tar.gz |
Fix a memory leak in jpeg_skip_scanlines()
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1591 632fc199-4ca6-4c93-a231-07263d6284db
-rw-r--r-- | jdapistd.c | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -192,8 +192,8 @@ dummy_buffer_setup (j_decompress_ptr cinfo) nc = (cinfo->out_color_space == JCS_RGB565) ? 2 : cinfo->out_color_components; cinfo->master->dummy_row_buffer = - jpeg_get_small((j_common_ptr) cinfo, - cinfo->output_width * nc * sizeof(JSAMPLE)); + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + cinfo->output_width * nc * sizeof(JSAMPLE)); } @@ -493,13 +493,6 @@ jpeg_finish_output (j_decompress_ptr cinfo) if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) return FALSE; /* Suspend, come back later */ } - /* Clean up row buffer */ - if (cinfo->master->dummy_row_buffer) { - int nc = (cinfo->out_color_space == JCS_RGB565) ? - 2 : cinfo->out_color_components; - jpeg_free_small((j_common_ptr) cinfo, cinfo->master->dummy_row_buffer, - cinfo->output_width * nc * sizeof(JSAMPLE)); - } cinfo->global_state = DSTATE_BUFIMAGE; return TRUE; } |