Changeset 1a4176cd60ddcddec2556b2679c7927569b2eaa7

Show
Ignore:
Timestamp:
14/06/07 08:13:25 (1 year ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1181801605 +0000
git-parent:

[3869712ac488d65f17a38dfb3f5b0044f623b4dc]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1181801605 +0000
Message:

Fix potential memleak/crash

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/video_output/vout_subpictures.c

    re3204e4 r1a4176c  
    278278{ 
    279279    subpicture_region_t *p_region = malloc( sizeof(subpicture_region_t) ); 
     280    if( !p_region ) return NULL; 
     281 
    280282    memset( p_region, 0, sizeof(subpicture_region_t) ); 
    281283    p_region->p_next = 0; 
     
    300302    { 
    301303        free( p_region ); 
    302         free( p_fmt->p_palette ); 
     304        if( p_fmt->p_palette ) free( p_fmt->p_palette ); 
    303305        return NULL; 
    304306    } 
     
    676678 
    677679            /* Force palette if requested */ 
    678             if( p_spu->b_force_palette && VLC_FOURCC('Y','U','V','P') == 
    679                 p_region->fmt.i_chroma
     680            if( p_spu->b_force_palette && 
     681                (VLC_FOURCC('Y','U','V','P') == p_region->fmt.i_chroma)
    680682            { 
    681683                memcpy( p_region->fmt.p_palette->palette,