fix possible segfault

This commit is contained in:
Jacek Jendrzej
2018-07-28 14:24:12 +02:00
parent e77090de83
commit eaca615348

View File

@@ -300,7 +300,8 @@ static int PlaybackPlay(Context_t *context)
context->playback->BackWard = 0;
context->playback->SlowMotion = 0;
context->playback->Speed = 0;
context->container->selectedContainer->Command(context, CONTAINER_STOP, NULL);
if (context->container && context->container->selectedContainer)
context->container->selectedContainer->Command(context, CONTAINER_STOP, NULL);
}
else
{
@@ -330,8 +331,8 @@ static int PlaybackPlay(Context_t *context)
playback_printf(10, "clearing isCreationPhase!\n");
context->playback->isCreationPhase = 0; // allow thread to go into next state
ret = context->container->selectedContainer->Command(context, CONTAINER_PLAY, NULL);
if (context->container && context->container->selectedContainer)
ret = context->container->selectedContainer->Command(context, CONTAINER_PLAY, NULL);
if (ret != 0)
{
playback_err("CONTAINER_PLAY failed!\n");