diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-03-12 17:29:48 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-03-12 17:29:48 +0000 |
commit | fdd4ddccd46830f9439d545c54da98d50bf49951 (patch) | |
tree | ec1c5bd12d32857d5869f4af301816ba7569ec52 /libmpcodecs | |
parent | e0c5806d44bc6cb56d41f54de585c8d02e74ad1a (diff) | |
download | mpv-fdd4ddccd46830f9439d545c54da98d50bf49951.tar.bz2 mpv-fdd4ddccd46830f9439d545c54da98d50bf49951.tar.xz |
Fix crash if speex_packet_to_header fails.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30883 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ad_speex.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libmpcodecs/ad_speex.c b/libmpcodecs/ad_speex.c index 4eca5293df..9abc1ad032 100644 --- a/libmpcodecs/ad_speex.c +++ b/libmpcodecs/ad_speex.c @@ -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); |