Skip to content

Commit

Permalink
Fix memory leak when running tjunittest -yuv
Browse files Browse the repository at this point in the history
Closes #61
  • Loading branch information
mayeut authored and dcommander committed Feb 25, 2016
1 parent 2d56acb commit f57bae0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.txt
Expand Up @@ -19,6 +19,9 @@ to construct a JPEG image in which a single Huffman block is over 430 bytes
long, so this version of libjpeg-turbo activates the accelerated Huffman
decoder only if there are > 512 bytes of data in the input buffer.

[3] Fixed a memory leak in tjunittest encountered when running the program
with the -yuv option.


1.4.2
=====
Expand Down
4 changes: 2 additions & 2 deletions tjunittest.c
Expand Up @@ -638,7 +638,7 @@ void bufSizeTest(void)
&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));
}
free(srcBuf); srcBuf=NULL;
if(!alloc)
if(!alloc || doyuv)
{
tjFree(dstBuf); dstBuf=NULL;
}
Expand Down Expand Up @@ -670,7 +670,7 @@ void bufSizeTest(void)
&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));
}
free(srcBuf); srcBuf=NULL;
if(!alloc)
if(!alloc || doyuv)
{
tjFree(dstBuf); dstBuf=NULL;
}
Expand Down

0 comments on commit f57bae0

Please sign in to comment.