[gst-cvs] gst-plugins-good: rtp: Fix compiler warning in h264 payloader

Jan Schmidt thaytan at kemper.freedesktop.org
Tue Feb 24 15:15:54 PST 2009


Module: gst-plugins-good
Branch: master
Commit: b4115aa83e0804b0e315a4ecf9ca037c00c26a48
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=b4115aa83e0804b0e315a4ecf9ca037c00c26a48

Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date:   Tue Feb 24 17:35:46 2009 +0000

rtp: Fix compiler warning in h264 payloader

Fix an undefined behaviour warning from gcc 4.4.0

Patch By: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Fixes: #570995
Signed-Off-By: Jan Schmidt <jan.schmidt at sun.com>

---

 gst/rtp/gstrtph264pay.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/gst/rtp/gstrtph264pay.c b/gst/rtp/gstrtph264pay.c
index 8fdd895..a788316 100644
--- a/gst/rtp/gstrtph264pay.c
+++ b/gst/rtp/gstrtph264pay.c
@@ -449,15 +449,17 @@ is_nal_equal (const guint8 * nal1, const guint8 * nal2, guint len)
   if (!remainder) {
     return TRUE;
   } else if (1 == remainder) {
-    return (nal1[--len] == nal2[len]);
+    --len;
+    return (nal1[len] == nal2[len]);
   } else {                      /* 2 or 3 */
     if (remainder & 1) {        /* -1 if 3 bytes left */
-      if (nal1[--len] != nal2[len])
+      --len;
+      if (nal1[len] != nal2[len])
         return FALSE;
     }
     /* last 2 bytes */
-    return ((nal1[--len] == nal2[len])  /* -1 */
-        &&(nal1[--len] == nal2[len]));  /* -2 */
+    return ((nal1[len - 1] == nal2[len - 1])    /* -1 */
+        &&(nal1[len - 2] == nal2[len - 2]));    /* -2 */
   }
 }
 





More information about the Gstreamer-commits mailing list