[MPlayer-dev-eng] [PATCH]Fix subcp crash(hopefully)

Salvador Eduardo Tropea salvador at inti.gov.ar
Fri Jan 17 16:34:14 CET 2003


Arpi wrote:

>>So, yes, {\ seems to be the correct start.
>>    
>>
>
>ok. patch?
>
Attached ;-)

>anyway i would be more happy if this whole { } elimination mess could be
>disabled by runtime or at least compiletime, for testing purposes.
>  
>
Ok, if you approbe this patch I´ll add a runtime option to disable it.

Here what I did:

1) Removed the code to remove {} from sub_read_line_ssa
2) Put this code in a separated function: sub_pp_ssa
3) After recoding added a call to sub_pp_ssa. To be more acqurate: I 
added a pointer to function to hold a postprocessing function to be 
invoked after using iconv. There are one pointer for each format, if 
this pointer isn´t NULL the post processing function is called.

Currently only SSA have such a pointer and points to sub_pp_ssa.
So now the remove is done with UTF-8 as input, as Rich pointed out 
that´s safe because UTF-8 text uses bit 7 on for any character outside 
the ASCII range. It ensures we won´t hit a { that isn´t a real {. I also 
added a check for \, so now what I remove is {\ .... }.

SET

-- 
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set at computer.org set at ieee.org 
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: subreader.dif
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030117/c3fca9db/attachment.asc>


More information about the MPlayer-dev-eng mailing list