From b4115aa83e0804b0e315a4ecf9ca037c00c26a48 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 24 Feb 2009 17:35:46 +0000 Subject: [PATCH] rtp: Fix compiler warning in h264 payloader MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix an undefined behaviour warning from gcc 4.4.0 Patch By: Tim-Philipp Müller Fixes: #570995 Signed-Off-By: Jan Schmidt --- gst/rtp/gstrtph264pay.c | 10 ++++++---- 1 file 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 */ } } -- 2.7.4