Throw exception if av_frame_alloc() fails.
authorCarl Hetherington <cth@carlh.net>
Thu, 27 Oct 2022 21:13:24 +0000 (23:13 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 27 Oct 2022 21:13:24 +0000 (23:13 +0200)
src/lib/audio_filter_graph.cc

index d9e4e244fd23aa4527d25f1840a21ec37a7b3512..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()