Skip to content

Commit

Permalink
Fix regressions introduced by git merge [fa2cc22]. This caused us to …
Browse files Browse the repository at this point in the history
…try to read past the end of a buffer.
  • Loading branch information
daniel-kristjansson committed May 10, 2011
1 parent 1f54f71 commit 2fd3685
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mythtv/libs/libmythtv/DeviceReadBuffer.cpp
Expand Up @@ -84,13 +84,16 @@ bool DeviceReadBuffer::Setup(const QString &streamName, int streamfd,
request_pause = false;
paused = false;

size = gCoreContext->GetNumSetting("HDRingbufferSize",
50 * TSPacket::kSize) * 1024;
read_quanta = (readQuanta) ? readQuanta : read_quanta;
size = gCoreContext->GetNumSetting(
"HDRingbufferSize", 50 * read_quanta) * 1024;
used = 0;
dev_read_size = TSPacket::kSize * (using_poll ? 256 : 48);
min_read = TSPacket::kSize * 4;
dev_read_size = read_quanta * (using_poll ? 256 : 48);
dev_read_size = (deviceBufferSize) ?
min(dev_read_size, (size_t)deviceBufferSize) : dev_read_size;
min_read = read_quanta * 4;

buffer = new unsigned char[size + TSPacket::kSize];
buffer = new unsigned char[size + dev_read_size];
readPtr = buffer;
writePtr = buffer;
endPtr = buffer + size;
Expand Down

0 comments on commit 2fd3685

Please sign in to comment.