From e78be631ba63d69080ae6ba46ad1861cbc257ba2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 28 Jul 2018 14:24:12 +0200 Subject: [PATCH] fix possible segfault Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/5e04171a83982878b338bd7ea83bb503ebea9ac7 Author: Jacek Jendrzej Date: 2018-07-28 (Sat, 28 Jul 2018) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/playback/playback.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libeplayer3-arm/playback/playback.c b/libeplayer3-arm/playback/playback.c index 97e0c9a..098cc4d 100644 --- a/libeplayer3-arm/playback/playback.c +++ b/libeplayer3-arm/playback/playback.c @@ -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");