Skip to content

Commit e8d07ea

Browse files
authored
Fix audio buffering crash (#927)
### Linked issues [#610](#610) ### Summarize your change. This update adds a check to audioCacheProgressGlyph() to confirm that the total frames is not less than or equal to 0. ### Describe the reason for the change. If audio buffering ends prematurely (ex: the EDL data is changed while a source's audio is being actively cached), this can cause audioCacheProgressGlyph to calculate the total frames as less than or equal to 0, which would cause the code to either divide by zero or draw a negative percentage glyph, which causes OpenRV to freeze. I added a check that the total frames are greater than 0. ### Describe what you have tested and on which operating system. Successfully tested on Rocky Linux 9.5. ### Add a list of changes, and note any that might need special attention during the review. ### If possible, provide screenshots. Signed-off-by: TJ Jackson <[email protected]>
1 parent 94973e0 commit e8d07ea

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/app/mu_rvui/rvui.mu

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5575,8 +5575,11 @@ global let enterFrame = startTextEntryMode(\: (string;) {"Go To Frame: ";}, goto
55755575
\: audioCacheProgressGlyph (void; bool outline)
55765576
{
55775577
let (_, u, _) = cacheUsage(),
5578-
total = (frameEnd() - frameStart()) / fps(),
5579-
pcent = u / total;
5578+
total = (frameEnd() - frameStart()) / fps();
5579+
5580+
if (total <= 0.0) return;
5581+
5582+
let pcent = u / total;
55805583

55815584
glColor(Color(.25, .25, .25, 1));
55825585
drawCircleFan(0, 0, 0.5, pcent, 1, .3, outline);

0 commit comments

Comments
 (0)