aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-03-04 14:11:44 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-03-04 14:11:44 +0000
commit76160e7e5c1510b995a067a40c1845afcbf3bf43 (patch)
tree6889034714cf7f31eda299ef01205729f491a02a /libmpdemux
parent0733dc5f01187d64177244e05fe5df4ad8439fb4 (diff)
Do not read more audio samples than available
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22445 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_avs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmpdemux/demux_avs.c b/libmpdemux/demux_avs.c
index aadbb6ef84..2a39b25cbd 100644
--- a/libmpdemux/demux_avs.c
+++ b/libmpdemux/demux_avs.c
@@ -208,7 +208,10 @@ static int demux_avs_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds)
{
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;