diff options
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux_disc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/demux/demux_disc.c b/demux/demux_disc.c index b3d4db30a8..5175f89e01 100644 --- a/demux/demux_disc.c +++ b/demux/demux_disc.c @@ -135,19 +135,21 @@ static void add_streams(demuxer_t *demuxer) } } struct sh_stream *sh = new_sh_stream(demuxer, src->type); + if (!sh) + break; assert(p->num_streams == n); // directly mapped MP_TARRAY_APPEND(p, p->streams, p->num_streams, sh); // Copy all stream fields that might be relevant sh->codec = talloc_strdup(sh, src->codec); sh->format = src->format; sh->lav_headers = src->lav_headers; - if (sh && src->video) { + if (src->video) { double ar; if (stream_control(demuxer->stream, STREAM_CTRL_GET_ASPECT_RATIO, &ar) == STREAM_OK) sh->video->aspect = ar; } - if (sh && src->audio) + if (src->audio) sh->audio = src->audio; } reselect_streams(demuxer); |