- p_dec->fmt_out.p_extra = (uint8_t*)malloc( p_dec->fmt_out.i_extra );
- memcpy( (uint8_t*)p_dec->fmt_out.p_extra, p_sys->p_sps->p_buffer, p_sys->p_sps->i_buffer);
- memcpy( (uint8_t*)p_dec->fmt_out.p_extra+p_sys->p_sps->i_buffer, p_sys->p_pps->p_buffer, p_sys->p_pps->i_buffer);
- p_sys->b_header = VLC_TRUE;
+ p_dec->fmt_out.p_extra = malloc( p_dec->fmt_out.i_extra );
+ if( p_dec->fmt_out.p_extra )
+ {
+ memcpy( (uint8_t*)p_dec->fmt_out.p_extra,
+ p_sys->p_sps->p_buffer, p_sys->p_sps->i_buffer);
+ memcpy( (uint8_t*)p_dec->fmt_out.p_extra+p_sys->p_sps->i_buffer,
+ p_sys->p_pps->p_buffer, p_sys->p_pps->i_buffer);
+ p_sys->b_header = true;
+ }
+ else p_dec->fmt_out.i_extra = 0;