summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Astafyev <dev@246060.ru>2019-11-30 08:30:18 +0300
committerErik de Castro Lopo <erikd@mega-nerd.com>2019-12-08 20:34:57 +1100
commit1f578f1b71bf5937d0084f91ad1d30ad1f5b79d4 (patch)
treedc8ee7ccc633d0017a1386c4f46c6e04fb6084f1
parent6455e477218360899c55f8dbd06c6628260d4123 (diff)
downloadflac-1f578f1b71bf5937d0084f91ad1d30ad1f5b79d4.tar.gz
libFLAC++: Delete decoder and encoder before return if they're not valid
-rw-r--r--src/test_libFLAC++/decoders.cpp3
-rw-r--r--src/test_libFLAC++/encoders.cpp1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/test_libFLAC++/decoders.cpp b/src/test_libFLAC++/decoders.cpp
index b1505eeb..a937f1fc 100644
--- a/src/test_libFLAC++/decoders.cpp
+++ b/src/test_libFLAC++/decoders.cpp
@@ -459,6 +459,7 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
printf("testing is_valid()... ");
if(!decoder->is_valid()) {
printf("FAILED, returned false\n");
+ delete decoder;
return false;
}
printf("OK\n");
@@ -481,6 +482,7 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
printf("testing is_valid()... ");
if(!decoder->is_valid()) {
printf("FAILED, returned false\n");
+ delete decoder;
return false;
}
printf("OK\n");
@@ -532,6 +534,7 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
printf("testing is_valid()... ");
if(!decoder->is_valid()) {
printf("FAILED, returned false\n");
+ delete decoder;
return false;
}
printf("OK\n");
diff --git a/src/test_libFLAC++/encoders.cpp b/src/test_libFLAC++/encoders.cpp
index e328a534..3fe0bb38 100644
--- a/src/test_libFLAC++/encoders.cpp
+++ b/src/test_libFLAC++/encoders.cpp
@@ -215,6 +215,7 @@ static bool test_stream_encoder(Layer layer, bool is_ogg)
printf("testing is_valid()... ");
if(!encoder->is_valid()) {
printf("FAILED, returned false\n");
+ delete decoder;
return false;
}
printf("OK\n");