Commit 229c385a authored by Fabian Yamaguchi's avatar Fabian Yamaguchi Committed by Jean-Baptiste Kempf

codec: dmo: avoid null-pointer dereference.

Check the return value of malloc to avoid a null-pointer dereference.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9bb0353a
......@@ -1324,6 +1324,9 @@ static int EncoderSetAudioType( encoder_t *p_enc, IMediaObject *p_dmo )
msg_Dbg( p_enc, "found cbSize: %i", p_wf->cbSize );
p_enc->fmt_out.i_extra = p_wf->cbSize;
p_enc->fmt_out.p_extra = malloc( p_enc->fmt_out.i_extra );
if( p_enc->fmt_out.p_extra == NULL)
return VLC_EGENERIC;
memcpy( p_enc->fmt_out.p_extra, &p_wf[1], p_enc->fmt_out.i_extra );
}
......
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