Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
7f16b568 by Steve Lhomme at 2026-01-07T11:12:42+00:00
codec: webvtt: fix potential crash

The CSSGrammar.y does set a TYPE_HEXCOLOR with a NULL string, so we handle
the error here.

Fixes #29309

- - - - -


1 changed file:

- modules/codec/webvtt/css_style.c


Changes:

=====================================
modules/codec/webvtt/css_style.c
=====================================
@@ -175,6 +175,8 @@ void webvtt_FillStyleFromCssDeclaration( const 
vlc_css_declaration_t *p_decl, te
                 term = &p_decl->expr->seq[i].term;
                 if( term->type < TYPE_STRING )
                     continue;
+                if( term->type == TYPE_HEXCOLOR && term->psz == NULL) // 
Handle error case: "color: #;"
+                    continue;
                 i_total += strlen( term->psz );
                 if( term->type == TYPE_STRING )
                     i_total += 2;
@@ -188,6 +190,8 @@ void webvtt_FillStyleFromCssDeclaration( const 
vlc_css_declaration_t *p_decl, te
                     term = &p_decl->expr->seq[i].term;
                     if( term->type < TYPE_STRING )
                         continue;
+                    if( term->type == TYPE_HEXCOLOR && term->psz == NULL) // 
Handle error case: "color: #;"
+                        continue;
                     if( i > 0 )
                         strcat( psz, ", " );
                     i_total += strlen( term->psz );



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/7f16b5681f11071d9a2847f2df53f0c81910213e

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/7f16b5681f11071d9a2847f2df53f0c81910213e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to