From 519c27a2bf0a693b43ce59a8376c6395b8427394 Mon Sep 17 00:00:00 2001 From: ltx Date: Thu, 14 May 2020 21:37:09 +0800 Subject: [PATCH] add fix-memory-leak-on-opening-corrupted-files.patch. --- ...mory-leak-on-opening-corrupted-files.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 fix-memory-leak-on-opening-corrupted-files.patch diff --git a/fix-memory-leak-on-opening-corrupted-files.patch b/fix-memory-leak-on-opening-corrupted-files.patch new file mode 100644 index 0000000..2f95ee2 --- /dev/null +++ b/fix-memory-leak-on-opening-corrupted-files.patch @@ -0,0 +1,21 @@ +commit cba2f967ebcc7e15d0f33e4219a1e04e2a6fc41e +Author: David Bryant +Date: Sun Dec 8 12:06:19 2019 -0800 + + fix possible memory leak on opening corrupted files + +diff --git a/src/open_utils.c b/src/open_utils.c +index 170c6eb..dfb7cf6 100644 +--- a/src/open_utils.c ++++ b/src/open_utils.c +@@ -177,6 +177,11 @@ WavpackContext *WavpackOpenFileInputEx64 (WavpackStreamReader64 *reader, void *w + return WavpackCloseFile (wpc); + } + ++ if (!wps->wphdr.block_samples) { // free blockbuff if we're going to loop again ++ free (wps->blockbuff); ++ wps->blockbuff = NULL; ++ } ++ + wps->init_done = TRUE; + }