[vlc-commits] [Git][videolan/vlc][master] demux: avi: cut QNap title on first invalid character
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Aug 21 13:17:00 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
9c5ea586 by Steve Lhomme at 2025-08-21T13:02:47+00:00
demux: avi: cut QNap title on first invalid character
We should only use valid UTF-8 metadata.
We don't know if this is supposed to be ASCII, UTF-8 or something else.
This is the same code as EnsureUTF8() except we cut the rest of the string if it's invalid.
Ref. #28976
- - - - -
1 changed file:
- modules/demux/avi/avi.c
Changes:
=====================================
modules/demux/avi/avi.c
=====================================
@@ -1051,7 +1051,21 @@ static void AVI_SendFrame( demux_t *p_demux, avi_track_t *tk, block_t *p_frame )
if( *psz_osd != 0 )
{
psz_osd[23] = 0;
- if( !psz_title || strncmp( psz_osd, psz_title, 24 ) )
+ {
+ char *str = psz_osd;
+ ssize_t n;
+ uint32_t cp;
+
+ while ((n = vlc_towc(str, &cp)) != 0)
+ if (likely(n != -1))
+ str += n;
+ else
+ {
+ *str = '\0';
+ break;
+ }
+ }
+ if( psz_osd[0] && ( !psz_title || strncmp( psz_osd, psz_title, 24 ) ) )
{
vlc_meta_Set( p_sys->meta, vlc_meta_Title, psz_osd );
p_sys->updates |= INPUT_UPDATE_META;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9c5ea58677b9f86e278a4c2c0b0fa738bf72ccd4
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9c5ea58677b9f86e278a4c2c0b0fa738bf72ccd4
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list