summaryrefslogtreecommitdiff
path: root/src/rmd_load_cache.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2021-01-06 00:45:28 -0800
committerVito Caputo <vcaputo@pengaru.com>2021-01-06 00:45:28 -0800
commitb3ebcb7895ec67469a67dff253dca90aba65111e (patch)
tree4e5db58e2a4e50ef3eefe57d18dfd3927bbb2d3d /src/rmd_load_cache.c
parent944ec32042d48b2ec78223a0a1582b239c38e55b (diff)
load_cache: fix divzero bug introduced by 5ce6553
--rescue mode doesn't set pdata->capture_frameno to the total The whole --rescue initialization path is a snowflake and should get reworked to share more in common with the normal startup. reported by @xloem, thanks!
Diffstat (limited to 'src/rmd_load_cache.c')
-rw-r--r--src/rmd_load_cache.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rmd_load_cache.c b/src/rmd_load_cache.c
index 303cc3b..5e5b8f7 100644
--- a/src/rmd_load_cache.c
+++ b/src/rmd_load_cache.c
@@ -217,8 +217,12 @@ void *rmdLoadCache(ProgData *pdata)
if (read_header(frame.header, icf)) {
- fprintf(stdout, "\r[%d%%] ",
- ((frame.header->capture_frameno) * 100) / pdata->capture_frameno);
+ if (pdata->capture_frameno)
+ fprintf(stdout, "\r[%d%%] ",
+ ((frame.header->capture_frameno) * 100) / pdata->capture_frameno);
+ else
+ fprintf(stdout, "\r[%d frames rendered] ",
+ frame.header->capture_frameno);
if (icf->chapter)
fprintf(stdout, "\t[Cache File %d]", icf->chapter);
fflush(stdout);
© All Rights Reserved