Commit 39cb8bd3 authored by Jean-Paul Saman's avatar Jean-Paul Saman

avcodec: check malloc return value.

parent 2f81c097
......@@ -814,10 +814,12 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
p_pic->i_qstride = p_sys->p_ff_pic->qstride;
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 );
switch( p_sys->p_ff_pic->qscale_type )
if( p_pic->p_q )
{
memcpy( p_pic->p_q, p_sys->p_ff_pic->qscale_table,
p_pic->i_qstride * i_mb_h );
switch( p_sys->p_ff_pic->qscale_type )
{
case FF_QSCALE_TYPE_MPEG1:
p_pic->i_qtype = QTYPE_MPEG1;
break;
......@@ -827,6 +829,7 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
case FF_QSCALE_TYPE_H264:
p_pic->i_qtype = QTYPE_H264;
break;
}
}
return p_pic;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment