Skip to content

Commit f57bae0

Browse files
mayeutdcommander
authored andcommitted
Fix memory leak when running tjunittest -yuv
Closes flutter#61
1 parent 2d56acb commit f57bae0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ChangeLog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ to construct a JPEG image in which a single Huffman block is over 430 bytes
1919
long, so this version of libjpeg-turbo activates the accelerated Huffman
2020
decoder only if there are > 512 bytes of data in the input buffer.
2121

22+
[3] Fixed a memory leak in tjunittest encountered when running the program
23+
with the -yuv option.
24+
2225

2326
1.4.2
2427
=====

tjunittest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ void bufSizeTest(void)
638638
&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));
639639
}
640640
free(srcBuf); srcBuf=NULL;
641-
if(!alloc)
641+
if(!alloc || doyuv)
642642
{
643643
tjFree(dstBuf); dstBuf=NULL;
644644
}
@@ -670,7 +670,7 @@ void bufSizeTest(void)
670670
&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));
671671
}
672672
free(srcBuf); srcBuf=NULL;
673-
if(!alloc)
673+
if(!alloc || doyuv)
674674
{
675675
tjFree(dstBuf); dstBuf=NULL;
676676
}

0 commit comments

Comments
 (0)