Throw exception if av_frame_alloc() fails.
[dcpomatic.git] / src / lib / audio_filter_graph.cc
index 95f6730cf4f24d99d43a981e6056c8058366406f..73c3aa6f7417c58c9a564ccc27115efb74496d8b 100644 (file)
@@ -53,6 +53,9 @@ AudioFilterGraph::AudioFilterGraph (int sample_rate, int channels)
        }
 
        _in_frame = av_frame_alloc ();
+       if (_in_frame == nullptr) {
+               throw std::bad_alloc();
+       }
 }
 
 AudioFilterGraph::~AudioFilterGraph()
@@ -106,7 +109,7 @@ AudioFilterGraph::sink_name () const
 }
 
 void
-AudioFilterGraph::process (shared_ptr<const AudioBuffers> buffers)
+AudioFilterGraph::process (shared_ptr<AudioBuffers> buffers)
 {
        DCPOMATIC_ASSERT (buffers->frames() > 0);
        int const process_channels = av_get_channel_layout_nb_channels (_channel_layout);