changeset 37163:caea6b4337d8

Check existence of a demuxer when updating global_sub_size. The GUI may call mpctx_get_global_sub_info() which forces updating global_sub_size even if there isn't yet a demuxer. This closes Trac #2201.
author ib
date Thu, 28 Aug 2014 19:34:05 +0000
parents b25434b964e0
children 22355747d51f
files command.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/command.c	Thu Aug 28 18:36:23 2014 +0000
+++ b/command.c	Thu Aug 28 19:34:05 2014 +0000
@@ -155,7 +155,7 @@
 
     // update number of demuxer sub streams
     for (i = 0; i < MAX_S_STREAMS; i++)
-        if (mpctx->demuxer->s_streams[i])
+        if (mpctx->demuxer && mpctx->demuxer->s_streams[i])
             cnt++;
     if (cnt > mpctx->sub_counts[SUB_SOURCE_DEMUX])
         mpctx->sub_counts[SUB_SOURCE_DEMUX] = cnt;
@@ -168,7 +168,7 @@
     // update global_sub_pos if we auto-detected a demuxer sub
     if (mpctx->global_sub_pos == -1) {
         int sub_id = -1;
-        if (mpctx->demuxer->sub)
+        if (mpctx->demuxer && mpctx->demuxer->sub)
             sub_id = mpctx->demuxer->sub->id;
         if (sub_id < 0)
             sub_id = dvdsub_id;