Changeset 1016

Show
Ignore:
Timestamp:
01/19/09 21:26:38 (1 year ago)
Author:
astrange
Message:

Fix layer comparison to not read from random pointers.

Files:

Legend:

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

    r1013 r1016  
    204204static int compare_layer(const void *a, const void *b) 
    205205{ 
    206         const SubRenderDiv *divA = a, *divB = b; 
    207          
     206        const SubRenderDiv *divA = *(id*)a, *divB = *(id*)b; 
     207 
    208208        if (divA->layer < divB->layer) return -1; 
    209209        else if (divA->layer > divB->layer) return 1; 
  • trunk/Subtitles/SubUtilities.m

    r923 r1016  
    6363         
    6464        [array getObjects:objs]; 
    65         mergesort(objs, count, sizeof(void*), compare); 
     65        mergesort(objs, count, sizeof(id), compare); 
    6666        [array setArray:[NSArray arrayWithObjects:objs count:count]]; 
    6767}