[FFmpeg-cvslog] svq3: use memmove to avoid overlap in memcpy.

Michael Niedermayer git at videolan.org
Thu Jan 16 02:46:56 CET 2014


ffmpeg | branch: release/1.2 | Michael Niedermayer <michaelni at gmx.at> | Thu Apr 18 17:54:54 2013 +0200| [a92b73da9907cc6819b5a476747a5ab44c797c88] | committer: Michael Niedermayer

svq3: use memmove to avoid overlap in memcpy.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 4c8ce750abaa783109630d41ca7dde5de34f6197)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a92b73da9907cc6819b5a476747a5ab44c797c88
---

 libavcodec/svq3.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 0481c80..3c17e0f 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -790,8 +790,8 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
                     header ^ s->watermark_key);
         }
         if (length > 0) {
-            memcpy((uint8_t *) &h->gb.buffer[get_bits_count(&h->gb) >> 3],
-                   &h->gb.buffer[h->gb.size_in_bits >> 3], length - 1);
+            memmove((uint8_t *) &h->gb.buffer[get_bits_count(&h->gb) >> 3],
+                    &h->gb.buffer[h->gb.size_in_bits >> 3], length - 1);
         }
         skip_bits_long(&h->gb, 0);
     }



More information about the ffmpeg-cvslog mailing list