Changeset 1273e688ac65d244afc540ba0bcf1b1edf06797b

Show
Ignore:
Timestamp:
03/09/08 22:48:19 (3 months ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1220474899 +0200
git-parent:

[cb1b8ce047c8b8e2f2ca6863950ee8ff128f4c42]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1220474823 +0200
Message:

Properly malloc(), memcpy() and free() the quantizer matrix. (Somebody please patch libmpeg2 so we can postproc it's output too!) Thanks to fenrir for his help.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_vout.h

    r2649d28 r1273e68  
    159159    if( p_picture->pf_release ) 
    160160        p_picture->pf_release( p_picture ); 
     161} 
     162 
     163/** 
     164 * Cleanup quantization matrix data and set to 0 
     165 */ 
     166static inline void picture_CleanupQuant( picture_t *p_pic ) 
     167{ 
     168    free( p_pic->p_q ); 
     169    p_pic->p_q = NULL; 
     170    p_pic->i_qstride = 0; 
     171    p_pic->i_qtype = 0; 
    161172} 
    162173 
  • modules/codec/avcodec/video.c

    r0ef30fa r1273e68  
    652652 
    653653            p_pic->i_qstride = p_sys->p_ff_pic->qstride; 
    654 #if 1 
    655             p_pic->p_q = p_sys->p_ff_pic->qscale_table; /* XXX: is this dangerous? shouldn't be since the ff pics are never freed ... but you never know */ 
    656 #else 
    657             /* FIXME: this leaks p_q */ 
    658654            int i_mb_h = ( p_pic->format.i_height + 15 ) / 16; 
    659655            p_pic->p_q = malloc( p_pic->i_qstride * i_mb_h ); 
    660656            memcpy( p_pic->p_q, p_sys->p_ff_pic->qscale_table, 
    661657                    p_pic->i_qstride * i_mb_h ); 
    662 #endif 
    663658            switch( p_sys->p_ff_pic->qscale_type ) 
    664659            { 
  • modules/stream_out/mosaic_bridge.c

    r18d635e r1273e68  
    9191    else 
    9292    { 
     93        free( p_pic->p_q ); 
    9394        free( p_pic->p_data_orig ); 
    9495        free( p_pic ); 
  • modules/stream_out/transcode.c

    r674559b r1273e68  
    22792279    if( p_pic ) 
    22802280    { 
     2281        free( p_pic->p_q ); 
    22812282        free( p_pic->p_data_orig ); 
    22822283        free( p_pic->p_sys ); 
     
    22902291    p_pic->i_refcount = 0; 
    22912292    p_pic->i_status = DESTROYED_PICTURE; 
     2293    picture_CleanupQuant( p_pic ); 
    22922294} 
    22932295 
     
    22972299    p_pic->i_refcount = 0; 
    22982300    p_pic->i_status = DESTROYED_PICTURE; 
     2301    picture_CleanupQuant( p_pic ); 
    22992302} 
    23002303 
  • src/input/decoder.c

    re27889c r1273e68  
    710710    { 
    711711        p_pic->i_status = DESTROYED_PICTURE; 
     712        picture_CleanupQuant( p_pic ); 
    712713        p_vout->i_heap_size--; 
    713714    } 
  • src/video_output/video_output.c

    ree542a4 r1273e68  
    12541254        p_picture->i_status = DESTROYED_PICTURE; 
    12551255        p_vout->i_heap_size--; 
     1256        picture_CleanupQuant( p_picture ); 
    12561257    } 
    12571258    vlc_mutex_unlock( &p_vout->picture_lock ); 
  • src/video_output/vout_pictures.c

    r3cbe2bd r1273e68  
    263263    p_pic->i_status = DESTROYED_PICTURE; 
    264264    p_vout->i_heap_size--; 
     265    picture_CleanupQuant( p_pic ); 
    265266 
    266267    vlc_mutex_unlock( &p_vout->picture_lock ); 
     
    295296        p_pic->i_status = DESTROYED_PICTURE; 
    296297        p_vout->i_heap_size--; 
     298        picture_CleanupQuant( p_pic ); 
    297299    } 
    298300 
     
    10461048    assert( p_picture && p_picture->i_refcount == 0 ); 
    10471049 
     1050    free( p_picture->p_q ); 
    10481051    free( p_picture->p_data_orig ); 
    10491052    free( p_picture->p_sys ); 
     
    10981101 *****************************************************************************/ 
    10991102 
    1100