[MPlayer-cvslog] r35351 - trunk/libmpcodecs/ad_ffmpeg.c
reimar
subversion at mplayerhq.hu
Mon Nov 5 22:02:38 CET 2012
Author: reimar
Date: Mon Nov 5 22:02:38 2012
New Revision: 35351
Log:
Fix potential NULL dereference.
Modified:
trunk/libmpcodecs/ad_ffmpeg.c
Modified: trunk/libmpcodecs/ad_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/ad_ffmpeg.c Mon Nov 5 21:58:38 2012 (r35350)
+++ trunk/libmpcodecs/ad_ffmpeg.c Mon Nov 5 22:02:38 2012 (r35351)
@@ -150,12 +150,12 @@ static int init(sh_audio_t *sh_audio)
if(sh_audio->format==0x3343414D){
// MACE 3:1
sh_audio->ds->ss_div = 2*3; // 1 samples/packet
- sh_audio->ds->ss_mul = 2*sh_audio->wf->nChannels; // 1 byte*ch/packet
+ sh_audio->ds->ss_mul = sh_audio->wf ? 2*sh_audio->wf->nChannels : 2; // 1 byte*ch/packet
} else
if(sh_audio->format==0x3643414D){
// MACE 6:1
sh_audio->ds->ss_div = 2*6; // 1 samples/packet
- sh_audio->ds->ss_mul = 2*sh_audio->wf->nChannels; // 1 byte*ch/packet
+ sh_audio->ds->ss_mul = sh_audio->wf ? 2*sh_audio->wf->nChannels : 2; // 1 byte*ch/packet
}
// Decode at least 1 byte: (to get header filled)
More information about the MPlayer-cvslog
mailing list