[vlc-devel] [PATCH] fix abort (crash) if EPG string is not UTF8

Abylay Ospan aospan at netup.ru
Tue Nov 21 20:55:59 CET 2017


Agree. My original patch not fixing root cause of this problem. Below is
more details and sample. Need to decide what the best way to fix this
problem and I will try to fix. Should we convert all EIT strings to UTF-8 ?
If yes then possibly somewhere in libdvbpsi (as it may obtain character
set) ?
As I understand vlc GUI accept only UTF8 strings, right ?
How does it work now and how it should work (correct) ?


--- additional details

TS Sample (54MB). This is ATSC full TS dump. Obtained in Miami, FL,
USA. 671Mhz. just run latest vlc with this file to see the problem.

https://drive.google.com/file/d/10HwVhyXk6TQK5-s60FnlZcircJ0_9tc7/view?usp=sharing

backtrace and hexdump of psz_val below. It contains "Abismo de pasión"
where symbol "ó" is 0xF3 (for example in windows-1252 charset).

#0  0x00007ffff73ff77f in __GI_raise (sig=sig at entry=6) at
../sysdeps/unix/sysv/linux/raise.c:58
#1  0x00007ffff740137a in __GI_abort () at abort.c:89
#2  0x00007ffff73f7b47 in __assert_fail_base (fmt=<optimized out>,
assertion=assertion at entry=0x7ffff7190310 "psz_val == NULL || IsUTF8(
psz_val )", file=file at entry=0x7ffff71901e0 "input/meta.c", line=line at entry=127,
function=function at entry=0x7ffff71903a8 <__PRETTY_FUNCTION__.11296>
"vlc_meta_Set") at assert.c:92
#3  0x00007ffff73f7bf2 in __GI___assert_fail
(assertion=assertion at entry=0x7ffff7190310
"psz_val == NULL || IsUTF8( psz_val )", file=file at entry=0x7ffff71901e0
"input/meta.c", line=line at entry=127, function=function at entry=0x7ffff71903a8
<__PRETTY_FUNCTION__.11296> "vlc_meta_Set")
    at assert.c:101
#4  0x00007ffff7124da8 in vlc_meta_Set (p_meta=<optimized out>,
meta_type=meta_type at entry=vlc_meta_ESNowPlaying,
psz_val=psz_val at entry=0x7fffa0c56860
"Abismo de pasi\363n") at input/meta.c:127
#5  0x00007ffff71187de in EsOutProgramEpg (p_epg=<optimized out>,
i_group=<optimized out>, out=<optimized out>) at input/es_out.c:1408
#6  0x00007ffff71187de in EsOutControlLocked (args=<optimized out>,
i_query=<optimized out>, out=<optimized out>) at input/es_out.c:2592
#7  0x00007ffff71187de in EsOutControl (out=<optimized out>,
i_query=<optimized out>, args=<optimized out>) at input/es_out.c:2863
#8  0x00007ffff7119009 in es_out_vaControl (args=0x7fffad1a37a0,
i_query=<optimized out>, out=<optimized out>) at ../include/vlc_es_out.h:143
#9  0x00007ffff7119009 in es_out_Control (out=<optimized out>,
i_query=<optimized out>) at ../include/vlc_es_out.h:152
#10 0x00007ffff711afee in ControlLocked (args=<optimized out>,
i_query=<optimized out>, p_out=<optimized out>) at
input/es_out_timeshift.c:664
#11 0x00007ffff711afee in Control (p_out=<optimized out>,
i_query=<optimized out>, args=<optimized out>) at
input/es_out_timeshift.c:762
#12 0x00007fffc7ae6ed9 in es_out_vaControl (args=0x7fffad1a3900,
i_query=14, out=<optimized out>) at ../include/vlc_es_out.h:143
#13 0x00007fffc7ae6ed9 in es_out_Control (out=<optimized out>,
i_query=i_query at entry=14) at ../include/vlc_es_out.h:152
#14 0x00007fffc7ae8767 in ATSC_EIT_Callback (p_pid=0x7fffa0c035b0,
p_eit=0x7fffa0c256d0) at demux/mpeg/ts_psip.c:505
#15 0x00007fffc78bf8c2 in  () at /usr/lib/x86_64-linux-gnu/libdvbpsi.so.10
#16 0x00007fffc78b5f35 in dvbpsi_packet_push () at
/usr/lib/x86_64-linux-gnu/libdvbpsi.so.10
#17 0x00007fffc7ae888b in ts_psip_Packet_Push (p_pid=<optimized out>,
p_pktbuffer=<optimized out>) at demux/mpeg/ts_psip.c:90
#18 0x00007fffc7adc8fc in Demux (p_demux=p_demux at entry=0x7fffa0c028e0) at
demux/mpeg/ts.c:737
#19 0x00007ffff7121de5 in demux_Demux (p_demux=<optimized out>) at
../include/vlc_demux.h:354
#20 0x00007ffff7121de5 in MainLoopDemux (pb_changed=<synthetic pointer>,
p_input=0x7fffa80009e0) at input/input.c:570
#21 0x00007ffff7121de5 in MainLoop (p_input=p_input at entry=0x7fffa80009e0,
b_interactive=b_interactive at entry=true) at input/input.c:716
#22 0x00007ffff71245bf in Run (data=0x7fffa80009e0) at input/input.c:506
#23 0x00007ffff799c6da in start_thread (arg=0x7fffad1a4700) at
pthread_create.c:456
#24 0x00007ffff74d2d7f in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:105

(gdb) x/16b psz_val
0x7fffa0c56860: 0x41    0x62    0x69    0x73    0x6d    0x6f    0x20    0x64
0x7fffa0c56868: 0x65    0x20    0x70    0x61    0x73    0x69    0xf3    0x6e




2017-11-21 11:04 GMT-05:00 Francois Cartegnie <fcvlcdev at free.fr>:

> Le 20/11/2017 à 22:52, Abylay Ospan a écrit :
> >  {
> >      free( p_meta->ppsz_meta[meta_type] );
> > -    assert( psz_val == NULL || IsUTF8( psz_val ) );
> > -    p_meta->ppsz_meta[meta_type] = psz_val ? strdup( psz_val ) : NULL;
> > +    p_meta->ppsz_meta[meta_type] = (psz_val && IsUTF8( psz_val )) ?
> strdup( psz_val ) : NULL;
> >  }
> >
> >  const char *vlc_meta_Get( const vlc_meta_t *p_meta, vlc_meta_type_t
> meta_type )
> >
>
> The right way to fix that kind of issues is to open a ticket and submit
> a sample, not to hide the bug.
>
> --
> Francois Cartegnie
> VideoLAN - VLC Developer
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel




-- 
Abylay Ospan,
NetUP Inc.
http://www.netup.tv
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20171121/9777132e/attachment.html>


More information about the vlc-devel mailing list