oops
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Sun, 30 Apr 2017 04:56:12 +0000 (00:56 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Sun, 30 Apr 2017 04:56:12 +0000 (00:56 -0400)
src/opusenc.c

index 88a8d10..4c49a04 100644 (file)
@@ -283,7 +283,7 @@ static void encode_buffer(OggOpusEnc *enc) {
   }
   /* If we've reached the end of the buffer, move everything back to the front. */
   if (enc->buffer_end == BUFFER_SAMPLES) {
-    memmove(enc->buffer, &enc->buffer[enc->channels*enc->buffer_start], enc->channels*(enc->buffer_end-enc->buffer_start));
+    memmove(enc->buffer, &enc->buffer[enc->channels*enc->buffer_start], enc->channels*(enc->buffer_end-enc->buffer_start)*sizeof(*enc->buffer));
     enc->buffer_end -= enc->buffer_start;
     enc->buffer_start = 0;
   }