[vlc-devel] [RFC PATCH 1/3] filter: pf_audio_filter: block_t can be NULL
Thomas Guillem
thomas at gllm.fr
Tue Nov 3 12:39:58 CET 2015
---
modules/audio_filter/audiobargraph_a.c | 3 ++
modules/audio_filter/channel_mixer/dolby.c | 3 ++
modules/audio_filter/channel_mixer/trivial.c | 21 +++++++++
modules/audio_filter/chorus_flanger.c | 3 ++
modules/audio_filter/compressor.c | 3 ++
modules/audio_filter/converter/a52tofloat32.c | 3 ++
modules/audio_filter/converter/a52tospdif.c | 3 ++
modules/audio_filter/converter/dtstofloat32.c | 3 ++
modules/audio_filter/converter/dtstospdif.c | 3 ++
modules/audio_filter/converter/format.c | 60 ++++++++++++++++++++++++
modules/audio_filter/equalizer.c | 3 ++
modules/audio_filter/gain.c | 3 ++
modules/audio_filter/karaoke.c | 3 ++
modules/audio_filter/normvol.c | 3 ++
modules/audio_filter/param_eq.c | 3 ++
modules/audio_filter/resampler/speex.c | 2 +
modules/audio_filter/resampler/src.c | 2 +
modules/audio_filter/resampler/ugly.c | 2 +
modules/audio_filter/scaletempo.c | 3 ++
modules/audio_filter/spatializer/spatializer.cpp | 3 ++
modules/audio_filter/stereo_widen.c | 3 ++
modules/visualization/glspectrum.c | 3 ++
modules/visualization/goom.c | 3 ++
modules/visualization/projectm.cpp | 3 ++
modules/visualization/visual/visual.c | 3 ++
modules/visualization/vsxu.cpp | 3 ++
26 files changed, 150 insertions(+)
diff --git a/modules/audio_filter/audiobargraph_a.c b/modules/audio_filter/audiobargraph_a.c
index 215c586..c6e10f8 100644
--- a/modules/audio_filter/audiobargraph_a.c
+++ b/modules/audio_filter/audiobargraph_a.c
@@ -165,6 +165,9 @@ static void SendValues(filter_t *p_filter, float *value, int nbChannels)
****************************************************************************/
static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
filter_sys_t *p_sys = p_filter->p_sys;
float *p_sample = (float *)p_in_buf->p_buffer;
float i_value[AOUT_CHAN_MAX];
diff --git a/modules/audio_filter/channel_mixer/dolby.c b/modules/audio_filter/channel_mixer/dolby.c
index 344d961..55ff6d2 100644
--- a/modules/audio_filter/channel_mixer/dolby.c
+++ b/modules/audio_filter/channel_mixer/dolby.c
@@ -159,6 +159,9 @@ static void Destroy( vlc_object_t *p_this )
*****************************************************************************/
static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
filter_sys_t * p_sys = p_filter->p_sys;
float * p_in = (float*) p_in_buf->p_buffer;
size_t i_nb_samples = p_in_buf->i_nb_samples;
diff --git a/modules/audio_filter/channel_mixer/trivial.c b/modules/audio_filter/channel_mixer/trivial.c
index c75c4e1..439b955 100644
--- a/modules/audio_filter/channel_mixer/trivial.c
+++ b/modules/audio_filter/channel_mixer/trivial.c
@@ -50,6 +50,9 @@ vlc_module_end ()
*/
static block_t *Upmix( filter_t *p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
unsigned i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
unsigned i_output_nb = aout_FormatNbChannels( &p_filter->fmt_out.audio );
@@ -89,6 +92,9 @@ static block_t *Upmix( filter_t *p_filter, block_t *p_in_buf )
*/
static block_t *Downmix( filter_t *p_filter, block_t *p_buf )
{
+ if( !p_buf )
+ return NULL;
+
unsigned i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
unsigned i_output_nb = aout_FormatNbChannels( &p_filter->fmt_out.audio );
@@ -111,6 +117,9 @@ static block_t *Downmix( filter_t *p_filter, block_t *p_buf )
static block_t *CopyLeft( filter_t *p_filter, block_t *p_buf )
{
+ if( !p_buf )
+ return NULL;
+
float *p = (float *)p_buf->p_buffer;
for( unsigned i = 0; i < p_buf->i_nb_samples; i++ )
@@ -124,6 +133,9 @@ static block_t *CopyLeft( filter_t *p_filter, block_t *p_buf )
static block_t *CopyRight( filter_t *p_filter, block_t *p_buf )
{
+ if( !p_buf )
+ return NULL;
+
float *p = (float *)p_buf->p_buffer;
for( unsigned i = 0; i < p_buf->i_nb_samples; i++ )
@@ -137,6 +149,9 @@ static block_t *CopyRight( filter_t *p_filter, block_t *p_buf )
static block_t *ExtractLeft( filter_t *p_filter, block_t *p_buf )
{
+ if( !p_buf )
+ return NULL;
+
float *p_dest = (float *)p_buf->p_buffer;
const float *p_src = p_dest;
@@ -151,6 +166,9 @@ static block_t *ExtractLeft( filter_t *p_filter, block_t *p_buf )
static block_t *ExtractRight( filter_t *p_filter, block_t *p_buf )
{
+ if( !p_buf )
+ return NULL;
+
float *p_dest = (float *)p_buf->p_buffer;
const float *p_src = p_dest;
@@ -165,6 +183,9 @@ static block_t *ExtractRight( filter_t *p_filter, block_t *p_buf )
static block_t *ReverseStereo( filter_t *p_filter, block_t *p_buf )
{
+ if( !p_buf )
+ return NULL;
+
float *p = (float *)p_buf->p_buffer;
/* Reverse-stereo mode */
diff --git a/modules/audio_filter/chorus_flanger.c b/modules/audio_filter/chorus_flanger.c
index a69ed37..9684110 100644
--- a/modules/audio_filter/chorus_flanger.c
+++ b/modules/audio_filter/chorus_flanger.c
@@ -218,6 +218,9 @@ static inline void sanitize( float * f_value )
*/
static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
struct filter_sys_t *p_sys = p_filter->p_sys;
int i_chan;
unsigned i_samples = p_in_buf->i_nb_samples; /* number of samples */
diff --git a/modules/audio_filter/compressor.c b/modules/audio_filter/compressor.c
index e154fb5..6281ec9 100644
--- a/modules/audio_filter/compressor.c
+++ b/modules/audio_filter/compressor.c
@@ -297,6 +297,9 @@ static void Close( vlc_object_t *p_this )
static block_t * DoWork( filter_t * p_filter, block_t * p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
int i_samples = p_in_buf->i_nb_samples;
int i_channels = aout_FormatNbChannels( &p_filter->fmt_in.audio );
float *pf_buf = (float*)p_in_buf->p_buffer;
diff --git a/modules/audio_filter/converter/a52tofloat32.c b/modules/audio_filter/converter/a52tofloat32.c
index d2016bf..7aa95d2 100644
--- a/modules/audio_filter/converter/a52tofloat32.c
+++ b/modules/audio_filter/converter/a52tofloat32.c
@@ -299,6 +299,9 @@ static void Exchange( sample_t *restrict p_out, const sample_t *restrict p_in )
static block_t *Convert( filter_t *p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
filter_sys_t *p_sys = p_filter->p_sys;
#ifdef LIBA52_FIXED
sample_t i_sample_level = (1 << 24);
diff --git a/modules/audio_filter/converter/a52tospdif.c b/modules/audio_filter/converter/a52tospdif.c
index 2e4a820..dcb619b 100644
--- a/modules/audio_filter/converter/a52tospdif.c
+++ b/modules/audio_filter/converter/a52tospdif.c
@@ -77,6 +77,9 @@ static int Create( vlc_object_t *p_this )
*****************************************************************************/
static block_t *DoWork( filter_t * p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
/* AC3 is natively big endian. Most SPDIF devices have the native
* endianness of the computer system.
* On Mac OS X however, little endian devices are also common.
diff --git a/modules/audio_filter/converter/dtstofloat32.c b/modules/audio_filter/converter/dtstofloat32.c
index 7b76417..5d269af 100644
--- a/modules/audio_filter/converter/dtstofloat32.c
+++ b/modules/audio_filter/converter/dtstofloat32.c
@@ -243,6 +243,9 @@ static void Exchange( float * p_out, const float * p_in )
*****************************************************************************/
static block_t *Convert( filter_t *p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
filter_sys_t *p_sys = p_filter->p_sys;
sample_t i_sample_level = 1;
int i_flags = p_sys->i_flags;
diff --git a/modules/audio_filter/converter/dtstospdif.c b/modules/audio_filter/converter/dtstospdif.c
index 99c57bd..8fec91e 100644
--- a/modules/audio_filter/converter/dtstospdif.c
+++ b/modules/audio_filter/converter/dtstospdif.c
@@ -118,6 +118,9 @@ static void Close( vlc_object_t * p_this )
*****************************************************************************/
static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
uint32_t i_ac5_spdif_type = 0;
uint16_t i_fz = p_in_buf->i_nb_samples * 4;
uint16_t i_frame, i_length = p_in_buf->i_buffer;
diff --git a/modules/audio_filter/converter/format.c b/modules/audio_filter/converter/format.c
index 5b946cf..7305f05 100644
--- a/modules/audio_filter/converter/format.c
+++ b/modules/audio_filter/converter/format.c
@@ -86,6 +86,9 @@ static int Open(vlc_object_t *object)
/*** from U8 ***/
static block_t *U8toS16(filter_t *filter, block_t *bsrc)
{
+ if (!bsrc)
+ return NULL;
+
block_t *bdst = block_Alloc(bsrc->i_buffer * 2);
if (unlikely(bdst == NULL))
goto out;
@@ -103,6 +106,9 @@ out:
static block_t *U8toFl32(filter_t *filter, block_t *bsrc)
{
+ if (!bsrc)
+ return NULL;
+
block_t *bdst = block_Alloc(bsrc->i_buffer * 4);
if (unlikely(bdst == NULL))
goto out;
@@ -120,6 +126,9 @@ out:
static block_t *U8toS32(filter_t *filter, block_t *bsrc)
{
+ if (!bsrc)
+ return NULL;
+
block_t *bdst = block_Alloc(bsrc->i_buffer * 4);
if (unlikely(bdst == NULL))
goto out;
@@ -137,6 +146,9 @@ out:
static block_t *U8toFl64(filter_t *filter, block_t *bsrc)
{
+ if (!bsrc)
+ return NULL;
+
block_t *bdst = block_Alloc(bsrc->i_buffer * 8);
if (unlikely(bdst == NULL))
goto out;
@@ -156,6 +168,9 @@ out:
/*** from S16N ***/
static block_t *S16toU8(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
VLC_UNUSED(filter);
int16_t *src = (int16_t *)b->p_buffer;
uint8_t *dst = (uint8_t *)src;
@@ -168,6 +183,9 @@ static block_t *S16toU8(filter_t *filter, block_t *b)
static block_t *S16toFl32(filter_t *filter, block_t *bsrc)
{
+ if (!bsrc)
+ return NULL;
+
block_t *bdst = block_Alloc(bsrc->i_buffer * 2);
if (unlikely(bdst == NULL))
goto out;
@@ -196,6 +214,9 @@ out:
static block_t *S16toS32(filter_t *filter, block_t *bsrc)
{
+ if (!bsrc)
+ return NULL;
+
block_t *bdst = block_Alloc(bsrc->i_buffer * 2);
if (unlikely(bdst == NULL))
goto out;
@@ -213,6 +234,9 @@ out:
static block_t *S16toFl64(filter_t *filter, block_t *bsrc)
{
+ if (!bsrc)
+ return NULL;
+
block_t *bdst = block_Alloc(bsrc->i_buffer * 4);
if (unlikely(bdst == NULL))
goto out;
@@ -232,6 +256,9 @@ out:
/*** from FL32 ***/
static block_t *Fl32toU8(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
float *src = (float *)b->p_buffer;
uint8_t *dst = (uint8_t *)src;
for (size_t i = b->i_buffer / 4; i--;)
@@ -252,6 +279,9 @@ static block_t *Fl32toU8(filter_t *filter, block_t *b)
static block_t *Fl32toS16(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
VLC_UNUSED(filter);
float *src = (float *)b->p_buffer;
int16_t *dst = (int16_t *)src;
@@ -280,6 +310,9 @@ static block_t *Fl32toS16(filter_t *filter, block_t *b)
static block_t *Fl32toS32(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
float *src = (float *)b->p_buffer;
int32_t *dst = (int32_t *)src;
for (size_t i = b->i_buffer / 4; i--;)
@@ -299,6 +332,9 @@ static block_t *Fl32toS32(filter_t *filter, block_t *b)
static block_t *Fl32toFl64(filter_t *filter, block_t *bsrc)
{
+ if (!bsrc)
+ return NULL;
+
block_t *bdst = block_Alloc(bsrc->i_buffer * 2);
if (unlikely(bdst == NULL))
goto out;
@@ -318,6 +354,9 @@ out:
/*** from S32N ***/
static block_t *S32toU8(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
VLC_UNUSED(filter);
int32_t *src = (int32_t *)b->p_buffer;
uint8_t *dst = (uint8_t *)src;
@@ -330,6 +369,9 @@ static block_t *S32toU8(filter_t *filter, block_t *b)
static block_t *S32toS16(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
VLC_UNUSED(filter);
int32_t *src = (int32_t *)b->p_buffer;
int16_t *dst = (int16_t *)src;
@@ -342,6 +384,9 @@ static block_t *S32toS16(filter_t *filter, block_t *b)
static block_t *S32toFl32(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
VLC_UNUSED(filter);
int32_t *src = (int32_t*)b->p_buffer;
float *dst = (float *)src;
@@ -352,6 +397,9 @@ static block_t *S32toFl32(filter_t *filter, block_t *b)
static block_t *S32toFl64(filter_t *filter, block_t *bsrc)
{
+ if (!bsrc)
+ return NULL;
+
block_t *bdst = block_Alloc(bsrc->i_buffer * 2);
if (unlikely(bdst == NULL))
goto out;
@@ -371,6 +419,9 @@ out:
/*** from FL64 ***/
static block_t *Fl64toU8(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
double *src = (double *)b->p_buffer;
uint8_t *dst = (uint8_t *)src;
for (size_t i = b->i_buffer / 8; i--;)
@@ -391,6 +442,9 @@ static block_t *Fl64toU8(filter_t *filter, block_t *b)
static block_t *Fl64toS16(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
VLC_UNUSED(filter);
double *src = (double *)b->p_buffer;
int16_t *dst = (int16_t *)src;
@@ -410,6 +464,9 @@ static block_t *Fl64toS16(filter_t *filter, block_t *b)
static block_t *Fl64toFl32(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
double *src = (double *)b->p_buffer;
float *dst = (float *)src;
for (size_t i = b->i_buffer / 8; i--;)
@@ -421,6 +478,9 @@ static block_t *Fl64toFl32(filter_t *filter, block_t *b)
static block_t *Fl64toS32(filter_t *filter, block_t *b)
{
+ if (!b)
+ return NULL;
+
double *src = (double *)b->p_buffer;
int32_t *dst = (int32_t *)src;
for (size_t i = b->i_buffer / 8; i--;)
diff --git a/modules/audio_filter/equalizer.c b/modules/audio_filter/equalizer.c
index 98a4a7e..37c986e 100644
--- a/modules/audio_filter/equalizer.c
+++ b/modules/audio_filter/equalizer.c
@@ -190,6 +190,9 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************/
static block_t * DoWork( filter_t * p_filter, block_t * p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
EqzFilter( p_filter, (float*)p_in_buf->p_buffer,
(float*)p_in_buf->p_buffer, p_in_buf->i_nb_samples,
aout_FormatNbChannels( &p_filter->fmt_in.audio ) );
diff --git a/modules/audio_filter/gain.c b/modules/audio_filter/gain.c
index c6c9339..fe6545e 100644
--- a/modules/audio_filter/gain.c
+++ b/modules/audio_filter/gain.c
@@ -108,6 +108,9 @@ static int Open( vlc_object_t *p_this )
static block_t *Process( filter_t *p_filter, block_t *p_block )
{
+ if( !p_block )
+ return NULL;
+
filter_sys_t *p_sys = p_filter->p_sys;
p_sys->volume.amplify( &p_sys->volume, p_block, p_sys->f_gain );
diff --git a/modules/audio_filter/karaoke.c b/modules/audio_filter/karaoke.c
index 8a1fb92..6e59136 100644
--- a/modules/audio_filter/karaoke.c
+++ b/modules/audio_filter/karaoke.c
@@ -61,6 +61,9 @@ static int Open (vlc_object_t *obj)
static block_t *Process (filter_t *filter, block_t *block)
{
+ if (!block)
+ return NULL;
+
const float factor = .70710678 /* 1. / sqrtf (2) */;
float *spl = (float *)block->p_buffer;
diff --git a/modules/audio_filter/normvol.c b/modules/audio_filter/normvol.c
index 6bcacdb..7fb449b 100644
--- a/modules/audio_filter/normvol.c
+++ b/modules/audio_filter/normvol.c
@@ -127,6 +127,9 @@ static int Open( vlc_object_t *p_this )
*****************************************************************************/
static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
float *pf_sum;
float *pf_gain;
float f_average = 0;
diff --git a/modules/audio_filter/param_eq.c b/modules/audio_filter/param_eq.c
index 9b984be..f55d2c1 100644
--- a/modules/audio_filter/param_eq.c
+++ b/modules/audio_filter/param_eq.c
@@ -166,6 +166,9 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************/
static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
ProcessEQ( (float*)p_in_buf->p_buffer, (float*)p_in_buf->p_buffer,
p_filter->p_sys->p_state,
p_filter->fmt_in.audio.i_channels, p_in_buf->i_nb_samples,
diff --git a/modules/audio_filter/resampler/speex.c b/modules/audio_filter/resampler/speex.c
index d41248e..9cc1620 100644
--- a/modules/audio_filter/resampler/speex.c
+++ b/modules/audio_filter/resampler/speex.c
@@ -120,6 +120,8 @@ static void Close (vlc_object_t *obj)
static block_t *Resample (filter_t *filter, block_t *in)
{
+ if (!in)
+ return NULL;
SpeexResamplerState *st = (SpeexResamplerState *)filter->p_sys;
const size_t framesize = filter->fmt_out.audio.i_bytes_per_frame;
diff --git a/modules/audio_filter/resampler/src.c b/modules/audio_filter/resampler/src.c
index b67be0e..190a292 100644
--- a/modules/audio_filter/resampler/src.c
+++ b/modules/audio_filter/resampler/src.c
@@ -122,6 +122,8 @@ static void Close (vlc_object_t *obj)
static block_t *Resample (filter_t *filter, block_t *in)
{
+ if (!in)
+ return NULL;
block_t *out = NULL;
const size_t framesize = filter->fmt_out.audio.i_bytes_per_frame;
diff --git a/modules/audio_filter/resampler/ugly.c b/modules/audio_filter/resampler/ugly.c
index 796c499..ead1531 100644
--- a/modules/audio_filter/resampler/ugly.c
+++ b/modules/audio_filter/resampler/ugly.c
@@ -90,6 +90,8 @@ static int CreateResampler( vlc_object_t *p_this )
*****************************************************************************/
static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
/* Check if we really need to run the resampler */
if( p_filter->fmt_out.audio.i_rate == p_filter->fmt_in.audio.i_rate )
return p_in_buf;
diff --git a/modules/audio_filter/scaletempo.c b/modules/audio_filter/scaletempo.c
index 4600ec3..f1671df 100644
--- a/modules/audio_filter/scaletempo.c
+++ b/modules/audio_filter/scaletempo.c
@@ -450,6 +450,9 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************/
static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
filter_sys_t *p = p_filter->p_sys;
if( p_filter->fmt_in.audio.i_rate == p->sample_rate )
diff --git a/modules/audio_filter/spatializer/spatializer.cpp b/modules/audio_filter/spatializer/spatializer.cpp
index 5059b83..26ea8fe 100644
--- a/modules/audio_filter/spatializer/spatializer.cpp
+++ b/modules/audio_filter/spatializer/spatializer.cpp
@@ -212,6 +212,9 @@ static void SpatFilter( filter_t *p_filter, float *out, float *in,
static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
SpatFilter( p_filter, (float*)p_in_buf->p_buffer,
(float*)p_in_buf->p_buffer, p_in_buf->i_nb_samples,
aout_FormatNbChannels( &p_filter->fmt_in.audio ) );
diff --git a/modules/audio_filter/stereo_widen.c b/modules/audio_filter/stereo_widen.c
index 796468a..da99f38 100644
--- a/modules/audio_filter/stereo_widen.c
+++ b/modules/audio_filter/stereo_widen.c
@@ -142,6 +142,9 @@ static int Open( vlc_object_t *obj )
*****************************************************************************/
static block_t *Filter( filter_t *p_filter, block_t *p_block )
{
+ if( !p_block )
+ return NULL;
+
filter_sys_t *p_sys = p_filter->p_sys;
float *p_out = (float *)p_block->p_buffer;
float *pf_read;
diff --git a/modules/visualization/glspectrum.c b/modules/visualization/glspectrum.c
index 8efdb8f..3a5c03f 100644
--- a/modules/visualization/glspectrum.c
+++ b/modules/visualization/glspectrum.c
@@ -193,6 +193,9 @@ static void Close(vlc_object_t *p_this)
*/
static block_t *DoWork(filter_t *p_filter, block_t *p_in_buf)
{
+ if( !p_in_buf )
+ return NULL;
+
block_t *block = block_Duplicate(p_in_buf);
if (likely(block != NULL))
block_FifoPut(p_filter->p_sys->fifo, block);
diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c
index d499d84..2942472 100644
--- a/modules/visualization/goom.c
+++ b/modules/visualization/goom.c
@@ -182,6 +182,9 @@ static int Open( vlc_object_t *p_this )
*****************************************************************************/
static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
filter_sys_t *p_sys = p_filter->p_sys;
block_t *p_block;
diff --git a/modules/visualization/projectm.cpp b/modules/visualization/projectm.cpp
index 2fe007d..d91e84a 100644
--- a/modules/visualization/projectm.cpp
+++ b/modules/visualization/projectm.cpp
@@ -236,6 +236,9 @@ static void Close( vlc_object_t *p_this )
*/
static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
filter_sys_t *p_sys = p_filter->p_sys;
vlc_mutex_lock( &p_sys->lock );
diff --git a/modules/visualization/visual/visual.c b/modules/visualization/visual/visual.c
index e323978..ffb5ca1 100644
--- a/modules/visualization/visual/visual.c
+++ b/modules/visualization/visual/visual.c
@@ -386,6 +386,9 @@ static void *Thread( void *data )
static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
block_t *block = block_Duplicate( p_in_buf );
if( likely(block != NULL) )
block_FifoPut( p_filter->p_sys->fifo, block );
diff --git a/modules/visualization/vsxu.cpp b/modules/visualization/vsxu.cpp
index a58e162..9814324 100644
--- a/modules/visualization/vsxu.cpp
+++ b/modules/visualization/vsxu.cpp
@@ -180,6 +180,9 @@ static void Close( vlc_object_t *p_this )
*/
static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
{
+ if( !p_in_buf )
+ return NULL;
+
filter_sys_t *p_sys = p_filter->p_sys;
vlc_mutex_lock( &p_sys->lock );
--
2.1.4
More information about the vlc-devel
mailing list