Skip to content

Commit 2b613f4

Browse files
howellrlRytoEX
authored andcommitted
media-playback: Fix null pointer dereference
1 parent 1af512f commit 2b613f4

File tree

1 file changed

+1
-2
lines changed
  • shared/media-playback/media-playback

1 file changed

+1
-2
lines changed

shared/media-playback/media-playback/media.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ void mp_media_next_audio(mp_media_t *m)
348348
struct mp_decode *d = &m->a;
349349
struct obs_source_audio audio = {0};
350350
AVFrame *f = d->frame;
351-
int channels = f->ch_layout.nb_channels;
352351

353352
if (!mp_media_can_play_frame(m, d))
354353
return;
@@ -361,7 +360,7 @@ void mp_media_next_audio(mp_media_t *m)
361360
audio.data[i] = f->data[i];
362361

363362
audio.samples_per_sec = f->sample_rate * m->speed / 100;
364-
audio.speakers = convert_speaker_layout(channels);
363+
audio.speakers = convert_speaker_layout(f->ch_layout.nb_channels);
365364
audio.format = convert_sample_format(f->format);
366365
audio.frames = f->nb_samples;
367366
audio.timestamp = m->full_decode ? d->frame_pts

0 commit comments

Comments
 (0)