From c62fd57328d8974a970dbc29eb9971dc28344f9c Mon Sep 17 00:00:00 2001 From: LJ Sonic Date: Wed, 1 Nov 2023 10:45:44 +0100 Subject: [PATCH] Fix incorrect error checking --- src/movie_decode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/movie_decode.c b/src/movie_decode.c index 5ac62c66a..607b29457 100644 --- a/src/movie_decode.c +++ b/src/movie_decode.c @@ -381,12 +381,11 @@ static void InitialiseAudioBuffer(movie_t *movie) { movieaudioframe_t *frame = EnqueueBuffer(&stream->framepool); - av_samples_alloc( + if (!av_samples_alloc( frame->samples, NULL, movie->frame->channels, movie->frame->nb_samples, AV_SAMPLE_FMT_S16, 1 - ); - if (!frame->samples) + )) I_Error("FFmpeg: cannot allocate samples"); } }