Add a couple of asserts.
authorCarl Hetherington <cth@carlh.net>
Mon, 15 May 2017 23:21:59 +0000 (00:21 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 15 May 2017 23:21:59 +0000 (00:21 +0100)
src/lib/ffmpeg_encoder.cc

index f26f66bfff320e909b598a54799eb183f8791ed6..eb7d476a834788605aecad224a384567367b5602 100644 (file)
@@ -300,7 +300,10 @@ FFmpegEncoder::audio_frame (int size)
        AVFrame* frame = av_frame_alloc ();
        DCPOMATIC_ASSERT (frame);
 
+       DCPOMATIC_ASSERT (size);
+
        int const channels = _audio_codec_context->channels;
+       DCPOMATIC_ASSERT (channels);
 
        int const buffer_size = av_samples_get_buffer_size (0, channels, size, _audio_codec_context->sample_fmt, 0);
        DCPOMATIC_ASSERT (buffer_size >= 0);