Using OPUS_MOVE() instead of OPUS_COPY() to move redundancy bytes
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 20 Sep 2016 05:44:22 +0000 (01:44 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 20 Sep 2016 05:44:22 +0000 (01:44 -0400)
memcpy() aliasing bug caught by Felicia's encoder fuzzing test

src/opus_encoder.c

index 4044010..0b66646 100644 (file)
@@ -2196,7 +2196,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
            /* Put CELT->SILK redundancy data in the right place. */
            if (redundancy && celt_to_silk && st->mode==MODE_HYBRID && st->use_vbr)
            {
-              OPUS_COPY(data+ret, data+nb_compr_bytes, redundancy_bytes);
+              OPUS_MOVE(data+ret, data+nb_compr_bytes, redundancy_bytes);
               nb_compr_bytes = nb_compr_bytes+redundancy_bytes;
            }
         }