avformat/mxg: Use memmove()
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 1 Sep 2015 20:45:07 +0000 (22:45 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 1 Sep 2015 20:46:23 +0000 (22:46 +0200)
Fixes undefined behavior
Fixes: 1700002963a49da13542e0726b7bb758/unknown_unknown_292_658_cov_2141972066_m1.mxg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mxg.c

index 3a34ebd..b95f542 100644 (file)
@@ -182,7 +182,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
                 if (mxg->soi_ptr - mxg->buffer > mxg->cache_size) {
                     if (mxg->cache_size > 0) {
-                        memcpy(mxg->buffer, mxg->buffer_ptr, mxg->cache_size);
+                        memmove(mxg->buffer, mxg->buffer_ptr, mxg->cache_size);
                     }
 
                     mxg->buffer_ptr = mxg->buffer;