[Spice-commits] src/display.js
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Dec 31 17:22:25 UTC 2019
src/display.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit e10791b986b17bad4996bf5e48909fdc93a6d446
Author: Joel Purra <mig at joelpurra.se>
Date: Thu Mar 29 20:00:51 2018 +0200
Check if streams array exists in handle_draw_jpeg_onload
- It seems `SpiceDisplayConn` does not always have the array `this.o.sc.streams` set.
- It also seems (stream?) images can be loaded before `streams` is set.
- Without `streams`, or the specific stream matching `this.o.id`, `this.o.sc.streams[this.o.id].frames_loading` cannot be accessed.
- The check for the specific stream woth `this.o.id` is already in place, this patch adds a check for `this.o.sc.streams` in `handle_draw_jpeg_onload`.
- There might be a better place to ensure that `this.o.sc.streams` is initialized; this quick fix saved my bacon today though.
Might be related to, and perhaps fix:
- https://bugs.freedesktop.org/show_bug.cgi?id=94776
- https://bugzilla.redhat.com/show_bug.cgi?id=1323144
Signed-off-by: Joel Purra <mig at joelpurra.se>
diff --git a/src/display.js b/src/display.js
index b3525f7..cac0715 100644
--- a/src/display.js
+++ b/src/display.js
@@ -899,7 +899,7 @@ function handle_draw_jpeg_onload()
var temp_canvas = null;
var context;
- if (this.o.sc.streams[this.o.id])
+ if ("streams" in this.o.sc && this.o.sc.streams[this.o.id])
this.o.sc.streams[this.o.id].frames_loading--;
/*------------------------------------------------------------
More information about the Spice-commits
mailing list