]> granicus.if.org Git - libjpeg-turbo/commitdiff
Fix memory leak when running tjunittest -yuv
authormayeut <mayeut@users.noreply.github.com>
Thu, 25 Feb 2016 22:14:45 +0000 (23:14 +0100)
committerDRC <information@libjpeg-turbo.org>
Thu, 25 Feb 2016 23:14:56 +0000 (17:14 -0600)
Closes #61

ChangeLog.txt
tjunittest.c

index 101a0669047b2d7654b1fd5719218b927bba56df..90e67f3b844c12f385b63cdbeaea2b00fed63886 100644 (file)
@@ -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
 =====
index 0c81cbe3923dc4393ec7fa452bfdb2c9ea4fee70..6a4022fd83f8119d9671c058af433a560250ef56 100644 (file)
@@ -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;
                                }
@@ -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;
                                }