Changeset 370

Show
Ignore:
Timestamp:
03/14/07 21:40:34 (2 years ago)
Author:
astrange
Message:

Fix memory leaks in subtitle parser; allow text with backslashes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SSATagParsing.m.rl

    r361 r370  
    193193                pcount = [linea count]; 
    194194        } 
    195          
     195 
    196196        for (; i < pcount; i ++) { 
    197197                SSARenderEntity *re = [[[SSARenderEntity alloc] init] autorelease]; 
     
    579579                                cmd = "\\"  cmd_specific; 
    580580                                 
    581                                 tag = "{" ((cmd*) | ([^\\}]*)) "}"; 
     581                                tag = "{" :> ((cmd*) | ([^\\}]*)) "}"; 
    582582                                 
    583583                                nl = "\\" [Nn]; 
     
    587587                                                                 
    588588                                text = any*; 
    589                                 main := (text :> special?)*; 
     589                                main := (text special?)*; 
    590590                        }%% 
    591591                                 
  • trunk/SubImport.mm

    r349 r370  
    372372} 
    373373 
     374-(void)dealloc 
     375{ 
     376        [outpackets release]; 
     377        [lines release]; 
     378        [super dealloc]; 
     379} 
     380 
    374381-(void)addLine:(SubLine *)sline 
    375382{ 
     
    462469                                         
    463470                                last_end = MAX(slines[j]->end_time, last_end); 
    464                                 if (accum) [accum appendString:slines[j]->line]; else accum = [slines[j]->line mutableCopy]; 
     471                                if (accum) [accum appendString:slines[j]->line]; else accum = [[slines[j]->line mutableCopy] autorelease]; 
    465472                        } else if (j == num-1) finishedOutput = true; 
    466473                }