changeset 15559:9f157ca7e3c2

Make sure that samplesize is at least 2, as some demuxers set it to 1 (demux_ogg for ac3 in ogm) or possibly even 0, and it causes preinit to set audio_out_minsize too low, which causes overflow (assert).
author hzoli
date Tue, 24 May 2005 06:54:19 +0000
parents 3aee7daaa8e5
children 3d1f21672c3e
files libmpcodecs/ad_liba52.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_liba52.c	Tue May 24 06:39:01 2005 +0000
+++ b/libmpcodecs/ad_liba52.c	Tue May 24 06:54:19 2005 +0000
@@ -126,6 +126,7 @@
 {
   /* Dolby AC3 audio: */
   /* however many channels, 2 bytes in a word, 256 samples in a block, 6 blocks in a frame */
+  if (sh->samplesize < 2) sh->samplesize = 2;
   sh->audio_out_minsize=audio_output_channels*sh->samplesize*256*6;
   sh->audio_in_minsize=3840;
   a52_level = 1.0;