[PATCH spice-gtk v4 1/7] display-gst: check codec type before creating decoder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Victor Toso <me@xxxxxxxxxxxxxx>

Inserting this check in channel-display-gst.c as the GStreamer decoder
is the only one handling all the different video formats supported by
spice-protocol.

If a unsupported/bad codec type value was sent, spice-gtk will fail to
create the decoder and any messages related to this stream-id will be
ignored.

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
Signed-off-by: Victor Toso <me@xxxxxxxxxxxxxx>
---
 src/channel-display-gst.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index 9b79403..d3e83e3 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -512,6 +512,8 @@ VideoDecoder* create_gstreamer_decoder(int codec_type, display_stream *stream)
 {
     SpiceGstDecoder *decoder = NULL;
 
+    g_return_val_if_fail(VALID_VIDEO_CODEC_TYPE(codec_type), NULL);
+
     if (gstvideo_init()) {
         decoder = spice_new0(SpiceGstDecoder, 1);
         decoder->base.destroy = spice_gst_decoder_destroy;
-- 
2.13.0

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]