summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/aviio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/aviio.c')
-rw-r--r--src/lib/util/aviio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/util/aviio.c b/src/lib/util/aviio.c
index 8598f868ba4..d664c8214ab 100644
--- a/src/lib/util/aviio.c
+++ b/src/lib/util/aviio.c
@@ -863,6 +863,13 @@ avi_error avi_read_sound_samples(avi_file *file, int channel, UINT32 firstsample
chunkbase = chunkend;
}
+ /* if we hit the end, fill the rest with silence */
+ if (chunknum == stream->chunks)
+ {
+ memset(output, 0, numsamples * 2);
+ break;
+ }
+
/* expand the tempbuffer to hold the data if necessary */
avierr = expand_tempbuffer(file, stream->chunk[chunknum].length);
if (avierr != AVIERR_NONE)