[MPlayer-cvslog] r37578 - in branches/1.2: . libmpcodecs/ad_dk3adpcm.c libmpcodecs/ad_imaadpcm.c libmpcodecs/ad_msadpcm.c

rtogni subversion at mplayerhq.hu
Wed Dec 30 23:37:41 CET 2015


Author: rtogni
Date: Wed Dec 30 23:37:41 2015
New Revision: 37578

Log:
Merge r37572 - r37575 from trunk

libmpcodecs/ad_dk3adpcm: Fix a division by zero.
libmpcodecs/ad_msadpcm: Fix a division by zero.
libmpcodecs/ad_imaadpcm: Fix a division by zero.
libmpcodecs/ad_dk3adpcm: Do not try to decode files with nBlockAlign == 0

Modified:
   branches/1.2/   (props changed)
   branches/1.2/libmpcodecs/ad_dk3adpcm.c
   branches/1.2/libmpcodecs/ad_imaadpcm.c
   branches/1.2/libmpcodecs/ad_msadpcm.c

Modified: branches/1.2/libmpcodecs/ad_dk3adpcm.c
==============================================================================
--- branches/1.2/libmpcodecs/ad_dk3adpcm.c	Wed Dec 30 21:31:35 2015	(r37577)
+++ branches/1.2/libmpcodecs/ad_dk3adpcm.c	Wed Dec 30 23:37:41 2015	(r37578)
@@ -88,8 +88,12 @@ static int preinit(sh_audio_t *sh_audio)
   sh_audio->audio_out_minsize = sh_audio->wf->nBlockAlign * 6;
   sh_audio->ds->ss_div =
     (sh_audio->wf->nBlockAlign - DK3_ADPCM_PREAMBLE_SIZE) * 8 / 3;
+  if (!sh_audio->ds->ss_div)
+    return 0;
   sh_audio->audio_in_minsize=
   sh_audio->ds->ss_mul = sh_audio->wf->nBlockAlign;
+  if (!sh_audio->audio_in_minsize)
+    return 0;
   return 1;
 }
 

Modified: branches/1.2/libmpcodecs/ad_imaadpcm.c
==============================================================================
--- branches/1.2/libmpcodecs/ad_imaadpcm.c	Wed Dec 30 21:31:35 2015	(r37577)
+++ branches/1.2/libmpcodecs/ad_imaadpcm.c	Wed Dec 30 23:37:41 2015	(r37578)
@@ -100,6 +100,8 @@ static int preinit(sh_audio_t *sh_audio)
   {
     sh_audio->ds->ss_div = (sh_audio->wf->nBlockAlign -
       (MS_IMA_ADPCM_PREAMBLE_SIZE * sh_audio->wf->nChannels)) * 2;
+    if (!sh_audio->ds->ss_div)
+      return 0;
     sh_audio->ds->ss_mul = sh_audio->wf->nBlockAlign;
   }
   else

Modified: branches/1.2/libmpcodecs/ad_msadpcm.c
==============================================================================
--- branches/1.2/libmpcodecs/ad_msadpcm.c	Wed Dec 30 21:31:35 2015	(r37577)
+++ branches/1.2/libmpcodecs/ad_msadpcm.c	Wed Dec 30 23:37:41 2015	(r37578)
@@ -80,6 +80,8 @@ static int preinit(sh_audio_t *sh_audio)
   sh_audio->audio_out_minsize = sh_audio->wf->nBlockAlign * 4;
   sh_audio->ds->ss_div =
     (sh_audio->wf->nBlockAlign - MS_ADPCM_PREAMBLE_SIZE) * 2;
+  if (!sh_audio->ds->ss_div)
+    return 0;
   sh_audio->audio_in_minsize =
   sh_audio->ds->ss_mul = sh_audio->wf->nBlockAlign;
   return 1;


More information about the MPlayer-cvslog mailing list