<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=647053214-26022003><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=647053214-26022003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=647053214-26022003><FONT face=Arial size=2>I just found a
memory leak in vobsub.c in vobsub_parse_one_line() where the variable 'line'
doesnt always get deleted </FONT></SPAN></DIV><SPAN class=647053214-26022003>
<DIV><FONT face=Arial><FONT size=2><SPAN class=647053214-26022003>i corrected it
so the function now looks like this:</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=647053214-26022003>static
int<BR>vobsub_parse_one_line(vobsub_t *vob, rar_stream_t
*fd)<BR>{<BR> ssize_t line_size;<BR> int res
= -1;<BR> do<BR>
{<BR> size_t line_reserve =
0;<BR> char *line =
NULL;<BR> line_size =
getline(&line, &line_reserve,
fd);<BR> if (line_size <
0)<BR>
{<BR> if
(line)<BR>
free(line);<BR>
break;<BR>
}<BR> if (*line == 0 || *line == '\r'
|| *line == '\n' || *line == '#')<BR>
{</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=647053214-26022003>
/* PATCH free line here as
well*/<BR> if
(line)<BR>
free(line);<BR>
continue;<BR>
}<BR> else if (strncmp("langidx:",
line, 8) ==
0)<BR> res =
vobsub_set_lang(line);<BR> else if
(strncmp("delay:", line, 6) ==
0)<BR> res =
vobsub_parse_delay(vob, line);<BR>
else if (strncmp("id:", line, 3) ==
0)<BR> res =
vobsub_parse_id(vob, line + 3);<BR>
else if (strncmp("palette:", line, 8) ==
0)<BR> res =
vobsub_parse_palette(vob, line +
8);<BR> else if (strncmp("size:",
line, 5) ==
0)<BR> res =
vobsub_parse_size(vob, line + 5);<BR>
else if (strncmp("org:", line, 4) ==
0)<BR> res =
vobsub_parse_origin(vob, line +
4);<BR> else if (strncmp("timestamp:",
line, 10) ==
0)<BR> res =
vobsub_parse_timestamp(vob, line +
10);<BR> else if (strncmp("custom
colors:", line, 14) ==
0)<BR>
//custom colors: ON/OFF, tridx: XXXX, colors: XXXXXX, XXXXXX,
XXXXXX,XXXXXX<BR>
res = vobsub_parse_cuspal(vob, line) + vobsub_parse_tridx(line) +
vobsub_parse_custom(vob, line);<BR>
else<BR>
{<BR>
//mp_msg(MSGT_VOBSUB,MSGL_V, "vobsub: ignoring %s",
line);<BR>
continue;<BR>
}</SPAN></FONT></FONT></DIV>
<DIV><SPAN class=647053214-26022003><FONT face=Arial
size=2> /* PATCH free line
here as well*/</FONT></SPAN></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=647053214-26022003> if
(line)<BR>
free(line);</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=647053214-26022003> <BR>
if (res < 0)<BR>
{<BR>
mp_msg(MSGT_VOBSUB,MSGL_ERR, "ERROR in %s",
line);
<BR>
break;<BR> }<BR>
}<BR> while (1);<BR> return
res;<BR>}<BR></SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=647053214-26022003></SPAN></FONT></FONT></SPAN> </DIV>
<DIV><SPAN class=647053214-26022003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=647053214-26022003><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><FONT size=2>
<P>Erwin Beckers</P>
<P>Solution Designer</P>
<P>Telematic System & Services BV</P>
<P>Hanzeweg 14</P>
<P>2803 MC Gouda</P>
<P>tel. +31-(0)182-531646</P>
<P>fax. +31-(0)182-535393</P></FONT><FONT face=Arial size=2>
<P>E-Mail: </FONT><U><FONT face=Arial color=#0000ff size=2><A
href="mailto:e.beckers@tss.nl">e.beckers@tss.nl</A></FONT></U></P>
<P><U><FONT face=Arial color=#0000ff size=2></U></FONT><FONT face=Arial
size=2>Internet: </FONT><U><FONT face=Arial color=#0000ff
size=2>http://www.tss.nl/</P></U></FONT></DIV>
<DIV> </DIV></BODY></HTML>