Add an assert for a function that can fail.
authorCarl Hetherington <cth@carlh.net>
Tue, 30 Mar 2021 10:14:18 +0000 (12:14 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 31 Mar 2021 20:51:05 +0000 (22:51 +0200)
src/lib/ffmpeg_decoder.cc

index c591ba30c09be4e812cb37f94f8ad7e3b1f3f0ee..147bb384f3eb1bad5a811adf9d624501b69eedf4 100644 (file)
@@ -234,6 +234,7 @@ DCPOMATIC_DISABLE_WARNINGS
                0, stream->stream(_format_context)->codec->channels, _frame->nb_samples, audio_sample_format (stream), 1
                );
 DCPOMATIC_ENABLE_WARNINGS
+       DCPOMATIC_ASSERT (size >= 0);
 
        /* XXX: can't we just use _frame->nb_samples directly here? */
        /* XXX: can't we use swr_convert() to do the format conversion? */