[rygel] engine-gst: Fix potential null access warnings



commit 1772ed926c562d4e0b9750bb6aeb71ffb0205c23
Author: Jens Georg <mail jensge org>
Date:   Thu Feb 13 23:34:07 2020 +0100

    engine-gst: Fix potential null access warnings

 src/media-engines/gstreamer/rygel-gst-sink.vala       | 2 +-
 src/media-engines/gstreamer/rygel-gst-transcoder.vala | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/media-engines/gstreamer/rygel-gst-sink.vala b/src/media-engines/gstreamer/rygel-gst-sink.vala
index 3bff4d52..a6f9149b 100644
--- a/src/media-engines/gstreamer/rygel-gst-sink.vala
+++ b/src/media-engines/gstreamer/rygel-gst-sink.vala
@@ -69,7 +69,7 @@ internal class Rygel.GstSink : Sink {
         this.frozen = false;
 
         if (this.offsets != null && this.offsets is HTTPByteSeekRequest) {
-            this.max_bytes = (this.offsets as HTTPByteSeekRequest).total_size;
+            this.max_bytes = ((HTTPByteSeekRequest) this.offsets).total_size;
             if (this.max_bytes == -1) {
                 this.max_bytes = int64.MAX;
             }
diff --git a/src/media-engines/gstreamer/rygel-gst-transcoder.vala 
b/src/media-engines/gstreamer/rygel-gst-transcoder.vala
index 8920109a..8f999374 100644
--- a/src/media-engines/gstreamer/rygel-gst-transcoder.vala
+++ b/src/media-engines/gstreamer/rygel-gst-transcoder.vala
@@ -95,7 +95,7 @@ internal abstract class Rygel.GstTranscoder : GLib.Object {
 
         // Retrieve the duration from primary media resource
         if (item is AudioItem) {
-            res.duration = (item as AudioItem).duration;
+            res.duration = ((AudioItem) item).duration;
         }
 
         return res;


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