ref: a46bb5c9733fef40e6cdcdcd2ac80106b5e18d7a
parent: 294847ad2742c94e0f61b56d5a9e02159d91b19e
author: Mark Harris <[email protected]>
date: Wed Feb 7 16:10:11 EST 2018
Eliminate dependency on Speex os_support.h
--- a/src/flac.c
+++ b/src/flac.c
@@ -248,7 +248,9 @@
/*We do allow the bits per sample to change, though this will confound Opus's
silence detection.*/
bits_per_sample=frame->header.bits_per_sample;
- speex_assert(bits_per_sample>0&&bits_per_sample<=32);
+ if(bits_per_sample<1||bits_per_sample>32){
+ return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
+ }
scale=(0x80000000U>>(bits_per_sample-1))*(1.0F/0x80000000U);
channel_permute=flac->channel_permute;
block_buf=flac->block_buf;
--- a/src/flac.h
+++ b/src/flac.h
@@ -24,7 +24,6 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
#include <stdio.h>
-#include "os_support.h"
#if defined(HAVE_LIBFLAC)
# include <FLAC/stream_decoder.h>
# include <FLAC/metadata.h>