videodecoder: Fix a leak introduced in fcb63e
authorJan Schmidt <jan@centricular.com>
Mon, 6 Mar 2017 08:14:48 +0000 (19:14 +1100)
committerJan Schmidt <jan@centricular.com>
Mon, 6 Mar 2017 08:14:48 +0000 (19:14 +1100)
CID: 1402055

gst-libs/gst/video/gstvideodecoder.c

index 8e2a623..b52ee1c 100644 (file)
@@ -1921,8 +1921,6 @@ gst_video_decoder_add_buffer_info (GstVideoDecoder * decoder,
   GstVideoDecoderPrivate *priv = decoder->priv;
   Timestamp *ts;
 
-  ts = g_slice_new (Timestamp);
-
   if (!GST_BUFFER_PTS_IS_VALID (buffer) &&
       !GST_BUFFER_DTS_IS_VALID (buffer) &&
       !GST_BUFFER_DURATION_IS_VALID (buffer) &&
@@ -1932,6 +1930,8 @@ gst_video_decoder_add_buffer_info (GstVideoDecoder * decoder,
     return;
   }
 
+  ts = g_slice_new (Timestamp);
+
   GST_LOG_OBJECT (decoder,
       "adding PTS %" GST_TIME_FORMAT " DTS %" GST_TIME_FORMAT
       " (offset:%" G_GUINT64_FORMAT ")",