]> git.sesse.net Git - vlc/blobdiff - modules/codec/avcodec/video.c
Properly malloc(), memcpy() and free() the quantizer matrix. (Somebody please patch...
[vlc] / modules / codec / avcodec / video.c
index 8b1076fa8d7bfa91865062992fecd6581861a3cc..f089504c8d16e7f54d6f85f8025afa13512f5cc9 100644 (file)
@@ -651,15 +651,10 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
             p_pic->b_top_field_first = p_sys->p_ff_pic->top_field_first;
 
             p_pic->i_qstride = p_sys->p_ff_pic->qstride;
-#if 1
-            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 */
-#else
-            /* FIXME: this leaks p_q */
             int i_mb_h = ( p_pic->format.i_height + 15 ) / 16;
             p_pic->p_q = malloc( p_pic->i_qstride * i_mb_h );
             memcpy( p_pic->p_q, p_sys->p_ff_pic->qscale_table,
                     p_pic->i_qstride * i_mb_h );
-#endif
             switch( p_sys->p_ff_pic->qscale_type )
             {
                 case FF_QSCALE_TYPE_MPEG1: