summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-08-21 04:18:12 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-08-21 04:18:12 +0000
commitfd883f1e7201ee7cde585088bfaa457ea3ae2108 (patch)
treee5c778fb1830e2fe56f0eeff1dd29e970d73fe0f /src/lib
parente6a22123879d762301d76f7768613c587244f95e (diff)
Fixed bug when writing AVI files with more than one RIFF chunk.
Added missing chdman error messages when extracting to an AVI file.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/aviio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/util/aviio.c b/src/lib/util/aviio.c
index d664c8214ab..3504352f79a 100644
--- a/src/lib/util/aviio.c
+++ b/src/lib/util/aviio.c
@@ -1719,8 +1719,10 @@ static avi_error chunk_write(avi_file *file, UINT32 type, const void *data, UINT
UINT32 written;
/* if we are getting too big, split the RIFF */
+ /* note that we ignore writes before the current RIFF base, as those are assumed to be
+ overwrites of a chunk from the previous RIFF */
if ((file->riffbase == 0 && file->writeoffs + length + compute_idx1_size(file) >= MAX_RIFF_SIZE) ||
- file->writeoffs + length - file->riffbase >= MAX_RIFF_SIZE)
+ (file->writeoffs >= file->riffbase && file->writeoffs + length - file->riffbase >= MAX_RIFF_SIZE))
{
/* close the movi list */
avierr = chunk_close(file);