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() {
|
void RiffVideo::decodeBlocks() {
|
||||||
|
do {
|
||||||
HeaderReader header(io_);
|
HeaderReader header(io_);
|
||||||
if (equal(header.getId(), CHUNK_ID_LIST)) {
|
if (equal(header.getId(), CHUNK_ID_LIST)) {
|
||||||
readList(header);
|
readList(header);
|
||||||
} else {
|
} else {
|
||||||
readChunk(header);
|
readChunk(header);
|
||||||
}
|
}
|
||||||
|
} while (!io_->eof() && io_->tell() < io_->size());
|
||||||
if (!io_->eof() && io_->tell() < io_->size()) {
|
|
||||||
decodeBlocks();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // RiffVideo::decodeBlock
|
} // RiffVideo::decodeBlock
|
||||||
|
|
||||||
void RiffVideo::readAviHeader() {
|
void RiffVideo::readAviHeader() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user