[MPlayer-cvslog] r22445 - trunk/libmpdemux/demux_avs.c

reimar subversion at mplayerhq.hu
Sun Mar 4 15:11:45 CET 2007


Author: reimar
Date: Sun Mar  4 15:11:44 2007
New Revision: 22445

Modified:
   trunk/libmpdemux/demux_avs.c

Log:
Do not read more audio samples than available

Modified: trunk/libmpdemux/demux_avs.c
==============================================================================
--- trunk/libmpdemux/demux_avs.c	(original)
+++ trunk/libmpdemux/demux_avs.c	Sun Mar  4 15:11:44 2007
@@ -208,7 +208,10 @@ static int demux_avs_fill_buffer(demuxer
     {
         sh_audio_t *sh_audio = ds->sh;
         int samples = sh_audio->samplerate;
-        uint64_t l = samples * sh_audio->channels * sh_audio->samplesize;
+        uint64_t l;
+        samples = FFMIN(samples, AVS->video_info->num_audio_samples - AVS->sampleno);
+        if (!samples) return 0;
+        l = samples * sh_audio->channels * sh_audio->samplesize;
         if (l > INT_MAX) {
             mp_msg(MSGT_DEMUX, MSGL_FATAL, "AVS: audio packet too big\n");
             return 0;



More information about the MPlayer-cvslog mailing list