[vlmc-devel] [PATCH] Fix crash caused by using Volume Slider when no media file is loaded in VLMC

Hugo Beauzée-Luyssen hugo at beauzee.fr
Mon Mar 7 10:34:26 CET 2016


On 03/07/2016 10:23 AM, FearNotMyCreed . wrote:
>  From 2159cb01d9035950c0bb4ea19ef10ca2a806be8a Mon Sep 17 00:00:00 2001
> From: Ankur Gupta <ankur.vision0 at gmail.com <mailto:ankur.vision0 at gmail.com>>
> Date: Mon, 7 Mar 2016 11:01:51 +0530
> Subject: [PATCH] Fix crash caused by using Volume Slider when no media
> file is
>   loaded in VLMC
> Fixed: A segmentation fault occurs when no media file is imported in the
> project and volume slider is clicked.
> This happens because the object m_sourceRenderer is NULL while the
> volume slider is clicked in given situation.
> P.S. This patch is my attempt at GSOC 2016. I am a student of Masters in
> Computer
> Science at BITS Pilani, Hyderabad Campus. Kindly revert if I should do
> more exhaustive patches.
> ---
>   src/Renderer/ClipRenderer.cpp     | 6 +++++-
>   src/Renderer/WorkflowRenderer.cpp | 6 +++++-
>   2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
> index aecdd0a..ec11e09 100644
> --- a/src/Renderer/ClipRenderer.cpp
> +++ b/src/Renderer/ClipRenderer.cpp
> @@ -150,7 +150,11 @@ ClipRenderer::getVolume() const
>   void ClipRenderer::setVolume( int volume )
>   {
>       //Returns 0 if the volume was set, -1 if it was out of range
> -    return m_sourceRenderer->setVolume( volume );
> +    //Handles the 'Clip Preview Window' VolSlider Crash when media file
> is not loaded
> +    if(m_sourceRenderer != NULL)
> +    {
> +    m_sourceRenderer->setVolume( volume );
> +    }
>   }
>
>   void
> diff --git a/src/Renderer/WorkflowRenderer.cpp
> b/src/Renderer/WorkflowRenderer.cpp
> index 24a9b55..dd2f88a 100644
> --- a/src/Renderer/WorkflowRenderer.cpp
> +++ b/src/Renderer/WorkflowRenderer.cpp
> @@ -277,7 +277,11 @@ WorkflowRenderer::getVolume() const
>   void WorkflowRenderer::setVolume( int volume )
>   {
>       //Returns 0 if the volume was set, -1 if it was out of range
> -    m_sourceRenderer->setVolume( volume );
> +    //Handles the 'Project Preview Window' VolSlider Crash when media
> file is not loaded
> +    if(m_sourceRenderer != NULL)
> +    {
> +    m_sourceRenderer->setVolume( volume );
> +    }
>   }
>
>   qint64
> --
> 1.9.1
>
>
>
> _______________________________________________
> Vlmc-devel mailing list
> Vlmc-devel at videolan.org
> https://mailman.videolan.org/listinfo/vlmc-devel
>
Hi,

The preferred way would be to follow the current convention in this 
file, which is to check the m_isRendering flag

Regards,


More information about the Vlmc-devel mailing list