[MPlayer-cvslog] r30883 - trunk/libmpcodecs/ad_speex.c
reimar
subversion at mplayerhq.hu
Fri Mar 12 18:29:49 CET 2010
Author: reimar
Date: Fri Mar 12 18:29:48 2010
New Revision: 30883
Log:
Fix crash if speex_packet_to_header fails.
Modified:
trunk/libmpcodecs/ad_speex.c
Modified: trunk/libmpcodecs/ad_speex.c
==============================================================================
--- trunk/libmpcodecs/ad_speex.c Fri Mar 12 18:21:05 2010 (r30882)
+++ trunk/libmpcodecs/ad_speex.c Fri Mar 12 18:29:48 2010 (r30883)
@@ -61,6 +61,10 @@ static int init(sh_audio_t *sh) {
return 0;
}
ctx->hdr = speex_packet_to_header((char *)&sh->wf[1], sh->wf->cbSize);
+ if (!ctx->hdr) {
+ mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "Invalid extradata!\n");
+ return 0;
+ }
if (ctx->hdr->nb_channels != 1 && ctx->hdr->nb_channels != 2) {
mp_msg(MSGT_DECAUDIO, MSGL_WARN, "Invalid number of channels (%i), "
"assuming mono\n", ctx->hdr->nb_channels);
More information about the MPlayer-cvslog
mailing list