Hi!

Attached patch fixes a warning, I suspect it makes the code more correct.

Please comment, Carl Eugen
From 0460da037b91bbc4d0fbca3b756f5c7d345bbbbc Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffm...@gmail.com>
Date: Thu, 18 Jan 2018 23:31:48 +0100
Subject: [PATCH] lavc/svq3: Do not write into memory defined as const.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes a warning on ppc:
libavcodec/svq3.c:1055:21: warning: passing argument 1 of ‘av_write_bswap32’ discards 'const' qualifier from pointer target type
---
 libavcodec/svq3.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index a937b2f..fc17081 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -1048,12 +1048,12 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
         }
         memcpy(s->slice_buf, s->gb.buffer + s->gb.index / 8, slice_bytes);
 
-        init_get_bits(&s->gb_slice, s->slice_buf, slice_bits);
-
         if (s->watermark_key) {
-            uint32_t header = AV_RL32(&s->gb_slice.buffer[1]);
-            AV_WL32(&s->gb_slice.buffer[1], header ^ s->watermark_key);
+            uint32_t header = AV_RL32(&s->slice_buf[1]);
+            AV_WL32(&s->slice_buf[1], header ^ s->watermark_key);
         }
+        init_get_bits(&s->gb_slice, s->slice_buf, slice_bits);
+
         if (length > 0) {
             memmove(s->slice_buf, &s->slice_buf[slice_length], length - 1);
         }
-- 
1.7.10.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to