Hello community,

here is the log from the commit of package gstreamer-plugins-bad for 
openSUSE:Factory checked in at 2020-01-12 23:16:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gstreamer-plugins-bad (Old)
 and      /work/SRC/openSUSE:Factory/.gstreamer-plugins-bad.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gstreamer-plugins-bad"

Sun Jan 12 23:16:23 2020 rev:100 rq:761779 version:1.16.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/gstreamer-plugins-bad/gstreamer-plugins-bad.changes  
    2019-12-18 14:46:03.273876488 +0100
+++ 
/work/SRC/openSUSE:Factory/.gstreamer-plugins-bad.new.6675/gstreamer-plugins-bad.changes
    2020-01-12 23:16:47.462647633 +0100
@@ -1,0 +2,9 @@
+Mon Jan  6 10:10:07 UTC 2020 - Bjørn Lie <[email protected]>
+
+- Add upstream bug fix patches:
+  + gst-bad-interlace-fixes.patch: Fix various issues with
+    interlace.
+  + gst-bad-autoconvert-fix-lock-less.patch: autoconvert: Fix
+    lock-less exchange or free condition.
+
+-------------------------------------------------------------------

New:
----
  gst-bad-autoconvert-fix-lock-less.patch
  gst-bad-interlace-fixes.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gstreamer-plugins-bad.spec ++++++
--- /var/tmp/diff_new_pack.oEtdFO/_old  2020-01-12 23:16:49.614648428 +0100
+++ /var/tmp/diff_new_pack.oEtdFO/_new  2020-01-12 23:16:49.626648433 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package gstreamer-plugins-bad
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -38,6 +38,10 @@
 Source:         
https://gstreamer.freedesktop.org/src/gst-plugins-bad/%{_name}-%{version}.tar.xz
 Source2:        gstreamer-plugins-bad.appdata.xml
 Source99:       baselibs.conf
+# PATCH-FIX-UPSTREAM gst-bad-interlace-fixes.patch -- Fix various issues with 
interlace
+Patch0:         gst-bad-interlace-fixes.patch
+# PATCH-FIX-UPSTREAM gst-bad-autoconvert-fix-lock-less.patch -- autoconvert: 
Fix lock-less exchange or free condition.
+Patch1:         gst-bad-autoconvert-fix-lock-less.patch
 
 BuildRequires:  Mesa-libGLESv3-devel
 BuildRequires:  fdupes
@@ -530,7 +534,7 @@
        --enable-introspection \
        --with-hls-crypto=openssl \
        %{nil}
-make %{?_smp_mflags}
+%make_build
 %endif
 
 %install

++++++ gst-bad-autoconvert-fix-lock-less.patch ++++++
>From 881246497fd257802ac923888e435ba35501cc4d Mon Sep 17 00:00:00 2001
From: Nicolas Dufresne <[email protected]>
Date: Thu, 19 Dec 2019 15:19:29 -0500
Subject: [PATCH] autoconvert: Fix lock-less exchange or free condition

Before this change, we would free the list we just have saved.

Fixes #1158
---
 gst/autoconvert/gstautoconvert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c
index 5d3d565af..c3db17740 100644
--- a/gst/autoconvert/gstautoconvert.c
+++ b/gst/autoconvert/gstautoconvert.c
@@ -895,7 +895,7 @@ gst_auto_convert_load_factories (GstAutoConvert * 
autoconvert)
 
   g_assert (all_factories);
 
-  if (g_atomic_pointer_compare_and_exchange (&autoconvert->factories, NULL,
+  if (!g_atomic_pointer_compare_and_exchange (&autoconvert->factories, NULL,
           all_factories)) {
     gst_plugin_feature_list_free (all_factories);
   }
-- 
2.24.1

++++++ gst-bad-interlace-fixes.patch ++++++
>From 9fb5c5f466fb707931bf783d9518c661c53f334e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <[email protected]>
Date: Tue, 3 Dec 2019 15:35:57 +0200
Subject: [PATCH] interlace: Increment phase_index before checking if we're at
 the end of the phase

Incrementing it afterwards will always have to phase_index >= 1 and we
will never be at the beginning (0) of the phase again, and thus never
reset timestamp tracking accordingly.

This was broken in bea13ef43b719aad96e28766cd4d23652a891a20 in 2010, and
causes interlace to run into integer overflows after 2^31 frames or
about 5 hours at 29.97fps. Due to usage of wrong types for the integers
this then causes negative numbers to be used in calculations and all
calculations spectacularly fail, leading to all following buffers to
have the timestamp of the first buffer minus one nanosecond.
---
 gst/interlace/gstinterlace.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gst/interlace/gstinterlace.c b/gst/interlace/gstinterlace.c
index e0ff1aa4b..8121eec01 100644
--- a/gst/interlace/gstinterlace.c
+++ b/gst/interlace/gstinterlace.c
@@ -899,13 +899,13 @@ gst_interlace_chain (GstPad * pad, GstObject * parent, 
GstBuffer * buffer)
     interlace->fields_since_timebase = 0;
   }
 
+  current_fields = format->n_fields[interlace->phase_index];
+  /* increment the phase index */
+  interlace->phase_index++;
   if (!format->n_fields[interlace->phase_index]) {
     interlace->phase_index = 0;
   }
 
-  current_fields = format->n_fields[interlace->phase_index];
-  /* increment the phase index */
-  interlace->phase_index++;
   GST_DEBUG ("incoming buffer assigned %d fields", current_fields);
 
   num_fields = interlace->stored_fields + current_fields;
-- 
2.24.1


>From 39a67657d7153662ed08eab6cb8da6d4e621f055 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <[email protected]>
Date: Tue, 3 Dec 2019 15:45:26 +0200
Subject: [PATCH] interlace: Store unsigned integers in unsigned integer types

And add some assertions to guard against overflows and out of bounds
reads.
---
 gst/interlace/gstinterlace.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/gst/interlace/gstinterlace.c b/gst/interlace/gstinterlace.c
index 8121eec01..39bcab99d 100644
--- a/gst/interlace/gstinterlace.c
+++ b/gst/interlace/gstinterlace.c
@@ -98,11 +98,11 @@ struct _GstInterlace
   int src_fps_d;
 
   GstBuffer *stored_frame;
-  gint stored_fields;
-  gint phase_index;
-  int field_index;              /* index of the next field to push, 0=top 
1=bottom */
+  guint stored_fields;
+  guint phase_index;
+  guint field_index;            /* index of the next field to push, 0=top 
1=bottom */
   GstClockTime timebase;
-  int fields_since_timebase;
+  guint fields_since_timebase;
   guint pattern_offset;         /* initial offset into the pattern */
   gboolean passthrough;
 };
@@ -849,7 +849,7 @@ gst_interlace_chain (GstPad * pad, GstObject * parent, 
GstBuffer * buffer)
   GstInterlace *interlace = GST_INTERLACE (parent);
   GstFlowReturn ret = GST_FLOW_OK;
   gint num_fields = 0;
-  int current_fields;
+  guint current_fields;
   const PulldownFormat *format;
   GstClockTime timestamp;
 
@@ -902,6 +902,7 @@ gst_interlace_chain (GstPad * pad, GstObject * parent, 
GstBuffer * buffer)
   current_fields = format->n_fields[interlace->phase_index];
   /* increment the phase index */
   interlace->phase_index++;
+  g_assert (interlace->phase_index < G_N_ELEMENTS (format->n_fields));
   if (!format->n_fields[interlace->phase_index]) {
     interlace->phase_index = 0;
   }
@@ -911,7 +912,7 @@ gst_interlace_chain (GstPad * pad, GstObject * parent, 
GstBuffer * buffer)
   num_fields = interlace->stored_fields + current_fields;
   while (num_fields >= 2) {
     GstBuffer *output_buffer;
-    int n_output_fields;
+    guint n_output_fields;
     gboolean interlaced = FALSE;
 
     GST_DEBUG ("have %d fields, %d current, %d stored",
@@ -948,6 +949,9 @@ gst_interlace_chain (GstPad * pad, GstObject * parent, 
GstBuffer * buffer)
 
     gst_interlace_decorate_buffer (interlace, output_buffer, n_output_fields,
         interlaced);
+    /* Guard against overflows here. If this ever happens, resetting the phase
+     * above would never happen because of some bugs */
+    g_assert (interlace->fields_since_timebase <= G_MAXUINT - n_output_fields);
     interlace->fields_since_timebase += n_output_fields;
     interlace->field_index ^= (n_output_fields & 1);
 
-- 
2.24.1


Reply via email to