[vlc-commits] codec: dmo: avoid null-pointer dereference.
Fabian Yamaguchi
git at videolan.org
Fri Mar 20 19:06:20 CET 2015
vlc/vlc-2.2 | branch: master | Fabian Yamaguchi <fyamagu at gwdg.de> | Fri Dec 5 15:37:05 2014 +0100| [4d544c599edbc1b9e7b6df5b196f5e2cb1be13f4] | committer: Jean-Baptiste Kempf
codec: dmo: avoid null-pointer dereference.
Check the return value of malloc to avoid a null-pointer dereference.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 229c385a79d48e41687fae8b4dfeaeef9c8c3eb7)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=4d544c599edbc1b9e7b6df5b196f5e2cb1be13f4
---
modules/codec/dmo/dmo.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/modules/codec/dmo/dmo.c b/modules/codec/dmo/dmo.c
index 161fd17..461aa8e 100644
--- a/modules/codec/dmo/dmo.c
+++ b/modules/codec/dmo/dmo.c
@@ -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 );
}
More information about the vlc-commits
mailing list