From 54893b008c9c9f86ace76a209f3c29f8860cd26f Mon Sep 17 00:00:00 2001 From: pheonix xx Date: Thu, 4 Nov 2021 21:25:31 -0700 Subject: [PATCH] The memory allocated for info.buffer has been done with malloc(). --- src/Mp3Decoder.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Mp3Decoder.cpp b/src/Mp3Decoder.cpp index a48a300..86360dc 100644 --- a/src/Mp3Decoder.cpp +++ b/src/Mp3Decoder.cpp @@ -1,16 +1,16 @@ /* Copyright (c) 2019, Dimitri Diakopoulos All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -37,6 +37,7 @@ using namespace nqr; #include "minimp3/minimp3.h" #include "minimp3/minimp3_ex.h" +#include #include void mp3_decode_internal(AudioData * d, const std::vector & fileData) @@ -55,7 +56,7 @@ void mp3_decode_internal(AudioData * d, const std::vector & fileData) d->samples.resize(info.samples); std::memcpy(d->samples.data(), info.buffer, sizeof(float) * info.samples); - delete info.buffer; + std::free(info.buffer); } //////////////////////