aboutsummaryrefslogtreecommitdiffstats
path: root/examples/alstreamcb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/alstreamcb.cpp')
-rw-r--r--examples/alstreamcb.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/alstreamcb.cpp b/examples/alstreamcb.cpp
index 994a9c97..c7ebcbe3 100644
--- a/examples/alstreamcb.cpp
+++ b/examples/alstreamcb.cpp
@@ -157,9 +157,9 @@ struct StreamPlayer {
int splblocksize{}, byteblocksize{};
if(mSampleFormat == SampleType::IMA4 || mSampleFormat == SampleType::MSADPCM)
{
- SF_CHUNK_INFO inf{ "fmt ", 4, 0, NULL };
+ SF_CHUNK_INFO inf{ "fmt ", 4, 0, nullptr };
SF_CHUNK_ITERATOR *iter = sf_get_chunk_iterator(mSndfile, &inf);
- if(!iter || sf_get_chunk_size(iter, &inf) != SF_ERR_NO_ERROR)
+ if(!iter || sf_get_chunk_size(iter, &inf) != SF_ERR_NO_ERROR || inf.datalen < 14)
mSampleFormat = SampleType::Int16;
else
{