Commit 4d544c59 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>
(cherry picked from commit 229c385a79d48e41687fae8b4dfeaeef9c8c3eb7)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 24b6aefc
......@@ -1319,6 +1319,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