[Spice-commits] server/red-worker.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Mon Sep 26 09:12:40 UTC 2016
server/red-worker.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit b009a7ff34cf424a000abaaf37da0cb6d327ee57
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Tue Jun 7 09:47:54 2016 +0100
Prevent setting invalid image compression values
In case of invalid value the original compression is unchanged.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
diff --git a/server/red-worker.c b/server/red-worker.c
index a2cd2e8..b3f6c12 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -956,9 +956,9 @@ static void handle_dev_set_compression(void *opaque, void *payload)
{
RedWorkerMessageSetCompression *msg = payload;
RedWorker *worker = opaque;
+ SpiceImageCompression image_compression = msg->image_compression;
- worker->image_compression = msg->image_compression;
- switch (worker->image_compression) {
+ switch (image_compression) {
case SPICE_IMAGE_COMPRESSION_AUTO_LZ:
spice_info("ic auto_lz");
break;
@@ -984,7 +984,9 @@ static void handle_dev_set_compression(void *opaque, void *payload)
break;
default:
spice_warning("ic invalid");
+ image_compression = worker->image_compression;
}
+ worker->image_compression = image_compression;
display_channel_compress_stats_print(worker->display_channel);
display_channel_compress_stats_reset(worker->display_channel);
More information about the Spice-commits
mailing list