From 2266501eb92d0365420849a6847945d585fa951f Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 21 Feb 2013 09:54:05 +0000 Subject: [PATCH] Small fix for File::createInputStream. --- .../juce_audio_processors/processors/juce_AudioProcessor.h | 2 +- modules/juce_core/files/juce_File.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/modules/juce_audio_processors/processors/juce_AudioProcessor.h index 76ac472759..8b7e53634e 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h @@ -107,7 +107,7 @@ public: let this pass through without being overwritten or cleared. Also note that the buffer may have more channels than are strictly necessary, - but your should only read/write from the ones that your filter is supposed to + but you should only read/write from the ones that your filter is supposed to be using. The number of samples in these buffers is NOT guaranteed to be the same for every diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index 0f4972d1c2..b97d99f94a 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -654,8 +654,10 @@ bool File::startAsProcess (const String& parameters) const //============================================================================== FileInputStream* File::createInputStream() const { - if (existsAsFile()) - return new FileInputStream (*this); + ScopedPointer fin (new FileInputStream (*this)); + + if (fin->openedOk()) + return fin.release(); return nullptr; }