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:15:20 (GMT)
commit71bf56ac3d344039d0aa57a6f4940a29dc813d45 (patch)
treee3999bca78b012b88cc19220e78e6beba133c0d3
parentee329febc8c97e784b2457fd6a1d75691304b2e5 (diff)
Reduce number of maximum frames for AC3 encoder so prevent buffer overflow
-rw-r--r--mythtv/libs/libmyth/audiooutputbase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mythtv/libs/libmyth/audiooutputbase.cpp b/mythtv/libs/libmyth/audiooutputbase.cpp
index 117f8d8..59a6fbd 100644
--- a/mythtv/libs/libmyth/audiooutputbase.cpp
+++ b/mythtv/libs/libmyth/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