Convert tail-recursion to loop to avoid stack exhaustion.
This commit is contained in:
parent
a783320520
commit
244799f480
@ -456,17 +456,14 @@ void RiffVideo::readChunk(HeaderReader& header_) {
|
||||
}
|
||||
|
||||
void RiffVideo::decodeBlocks() {
|
||||
do {
|
||||
HeaderReader header(io_);
|
||||
if (equal(header.getId(), CHUNK_ID_LIST)) {
|
||||
readList(header);
|
||||
} else {
|
||||
readChunk(header);
|
||||
}
|
||||
|
||||
if (!io_->eof() && io_->tell() < io_->size()) {
|
||||
decodeBlocks();
|
||||
}
|
||||
|
||||
} while (!io_->eof() && io_->tell() < io_->size());
|
||||
} // RiffVideo::decodeBlock
|
||||
|
||||
void RiffVideo::readAviHeader() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user