Add an assertion.
authorCarl Hetherington <cth@carlh.net>
Thu, 19 Dec 2019 12:53:30 +0000 (13:53 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 19 Dec 2019 12:53:30 +0000 (13:53 +0100)
src/lib/ffmpeg_decoder.cc

index 3c5a09aea965fb41e17c4562e17d35e72aa0a146..2f92b9b7c34aaa0ecd917c35693f4caf5015342e 100644 (file)
@@ -314,6 +314,7 @@ FFmpegDecoder::deinterleave_audio (shared_ptr<FFmpegAudioStream> stream) const
        case AV_SAMPLE_FMT_FLTP:
        {
                float** p = reinterpret_cast<float**> (_frame->data);
+               DCPOMATIC_ASSERT (_frame->channels <= channels);
                /* Sometimes there aren't as many channels in the _frame as in the stream */
                for (int i = 0; i < _frame->channels; ++i) {
                        memcpy (data[i], p[i], frames * sizeof(float));