[Spice-commits] 2 commits - server/inputs-channel.c server/mjpeg-encoder.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Mon Oct 17 09:50:31 UTC 2016
server/inputs-channel.c | 1 +
server/mjpeg-encoder.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 44624ed8bf774eb2c6b0fa1c097e87b3b9eef397
Author: Uri Lublin <uril at redhat.com>
Date: Sun Oct 16 14:44:52 2016 +0300
mjpeg_encoder_new: allocate memory after sanity check
This patch prevents a leak in case the function returns early
Found by coverity.
Signed-off-by: Uri Lublin <uril at redhat.com>
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/mjpeg-encoder.c b/server/mjpeg-encoder.c
index 1649516..d95c645 100644
--- a/server/mjpeg-encoder.c
+++ b/server/mjpeg-encoder.c
@@ -1372,10 +1372,11 @@ VideoEncoder *mjpeg_encoder_new(SpiceVideoCodecType codec_type,
bitmap_ref_t bitmap_ref,
bitmap_unref_t bitmap_unref)
{
- MJpegEncoder *encoder = spice_new0(MJpegEncoder, 1);
+ MJpegEncoder *encoder;
spice_return_val_if_fail(codec_type == SPICE_VIDEO_CODEC_TYPE_MJPEG, NULL);
+ encoder = spice_new0(MJpegEncoder, 1);
encoder->base.destroy = mjpeg_encoder_destroy;
encoder->base.encode_frame = mjpeg_encoder_encode_frame;
encoder->base.client_stream_report = mjpeg_encoder_client_stream_report;
commit 09b12a55d07f6901eea20362c975079860490683
Author: Uri Lublin <uril at redhat.com>
Date: Sun Oct 16 14:44:50 2016 +0300
input-channel: add a comment to mark fallthrough in switch
Signed-off-by: Uri Lublin <uril at redhat.com>
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/inputs-channel.c b/server/inputs-channel.c
index 85ca155..d0f534a 100644
--- a/server/inputs-channel.c
+++ b/server/inputs-channel.c
@@ -285,6 +285,7 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui
key_down->code == SCROLL_LOCK_SCAN_CODE) {
activate_modifiers_watch(inputs_channel, reds);
}
+ /* fallthrough */
}
case SPICE_MSGC_INPUTS_KEY_UP: {
SpiceMsgcKeyUp *key_up = message;
More information about the Spice-commits
mailing list