media-playback: Fix null pointer dereference

This commit is contained in:
Rob Howell
2025-06-16 19:05:56 -04:00
committed by Ryan Foster
parent 1af512f323
commit 2b613f40b4
+1 -2
View File
@@ -348,7 +348,6 @@ void mp_media_next_audio(mp_media_t *m)
struct mp_decode *d = &m->a;
struct obs_source_audio audio = {0};
AVFrame *f = d->frame;
int channels = f->ch_layout.nb_channels;
if (!mp_media_can_play_frame(m, d))
return;
@@ -361,7 +360,7 @@ void mp_media_next_audio(mp_media_t *m)
audio.data[i] = f->data[i];
audio.samples_per_sec = f->sample_rate * m->speed / 100;
audio.speakers = convert_speaker_layout(channels);
audio.speakers = convert_speaker_layout(f->ch_layout.nb_channels);
audio.format = convert_sample_format(f->format);
audio.frames = f->nb_samples;
audio.timestamp = m->full_decode ? d->frame_pts