summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2010-12-03 13:56:32 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2010-12-03 14:14:40 (GMT)
commitc8b1c9df53df21d4edf739f720631c589122a864 (patch)
treeb5ae9428abe61cf3069857bedafc41416df57669
parent6d782423b5b9f75fb46b4ff0f96f4cf0b84e1e39 (diff)
Reduce number of maximum frames for AC3 encoder so prevent buffer overflow
-rw-r--r--mythtv/libs/libmyth/audio/audiooutputbase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mythtv/libs/libmyth/audio/audiooutputbase.cpp b/mythtv/libs/libmyth/audio/audiooutputbase.cpp
index 117f8d8..59a6fbd 100644
--- a/mythtv/libs/libmyth/audio/audiooutputbase.cpp
+++ b/mythtv/libs/libmyth/audio/audiooutputbase.cpp
@@ -1236,7 +1236,7 @@ bool AudioOutputBase::AddFrames(void *in_buffer, int in_frames,
int remaining = len;
int to_get = 0;
// The AC3 encoder can only work on 128kB of data at a time
- int maxframes = ((INBUFSIZE / encoder->FrameSize()) *
+ int maxframes = ((INBUFSIZE / encoder->FrameSize() - 1) *
encoder->FrameSize()) & ~0xf;
do