[vlc-commits] codec: subsdec: fix deadloop (fix #18782)
Francois Cartegnie
git at videolan.org
Fri Sep 8 13:59:58 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Sep 8 13:47:00 2017 +0200| [3f0583c010c7015a3f190824cd7bdff16eebcbc8] | committer: Francois Cartegnie
codec: subsdec: fix deadloop (fix #18782)
introduced by sec fixes 62be394b2c711328f083cb63f261c200ac89a4bb
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3f0583c010c7015a3f190824cd7bdff16eebcbc8
---
modules/codec/subsdec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/codec/subsdec.c b/modules/codec/subsdec.c
index 864de27d9d..290c3f31c9 100644
--- a/modules/codec/subsdec.c
+++ b/modules/codec/subsdec.c
@@ -513,7 +513,10 @@ static char* ConsumeAttribute( const char** ppsz_subtitle, char** ppsz_attribute
while ( *psz_subtitle && *psz_subtitle != '=' )
psz_subtitle++;
if ( !*psz_subtitle )
+ {
+ *ppsz_subtitle = psz_subtitle;
return psz_attribute_name;
+ }
// Skip the '=' sign
psz_subtitle++;
@@ -542,7 +545,10 @@ static char* ConsumeAttribute( const char** ppsz_subtitle, char** ppsz_attribute
attr_len++;
}
if ( attr_len == 0 )
+ {
+ *ppsz_subtitle = psz_subtitle;
return psz_attribute_name;
+ }
if ( unlikely( !( *ppsz_attribute_value = malloc( attr_len + 1 ) ) ) )
{
free( psz_attribute_name );
More information about the vlc-commits
mailing list