libFLAC++: Delete decoder and encoder before return if they're not valid

This commit is contained in:
Andrey Astafyev 2019-11-30 08:30:18 +03:00 committed by Erik de Castro Lopo
parent 6455e47721
commit 1f578f1b71
2 changed files with 4 additions and 0 deletions

View File

@ -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");

View File

@ -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");