Browse Source

subsdelay: handle NULL segment text

In some rare cases psz_text can be NULL, which would end up being
passed to strlen, causing a crash.

Fix CD 524d077a-d613-4f2f-85b1-2a2af0747888

(cherry picked from commit 2322d55db3)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
cherry-pick-c5513cf9
Marvin Scholz 4 years ago
committed by Jean-Baptiste Kempf
parent
commit
c8cd3f95e3
  1. 2
      modules/spu/subsdelay.c

2
modules/spu/subsdelay.c

@ -1337,7 +1337,7 @@ static bool SubsdelayIsTextEmpty( const text_segment_t *p_segment )
{
while ( p_segment )
{
if ( strlen( p_segment->psz_text ) > 0 )
if ( p_segment->psz_text && strlen( p_segment->psz_text ) > 0 )
{
size_t offset = strspn( p_segment->psz_text, " " );
if ( p_segment->psz_text[offset] )

Loading…
Cancel
Save