aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-18 16:19:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-01-16 00:35:12 +0100
commitab38b390592df4ad941b8e7568b8dd7f0aa521ca (patch)
tree3b93f6ffd78bbd8054567d65bae3ded56aba87ca
parent5dde8ba59e90facf3f22a99cf0ea86569758e576 (diff)
downloadffmpeg-ab38b390592df4ad941b8e7568b8dd7f0aa521ca.tar.gz
evrcdec: use memmove() instead of memcpy() when regions can overlap.
This occurs also with valid files. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 5ae484e350e4f1b20b31802dac59ca3519627c0a) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/evrcdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/evrcdec.c b/libavcodec/evrcdec.c
index 5569ca2511..aec652ac8c 100644
--- a/libavcodec/evrcdec.c
+++ b/libavcodec/evrcdec.c
@@ -640,7 +640,7 @@ static void postfilter(EVRCContext *e, float *in, const float *coeff,
/* Short term postfilter */
synthesis_filter(temp, wcoef2, e->postfilter_iir, length, out);
- memcpy(e->postfilter_residual,
+ memmove(e->postfilter_residual,
e->postfilter_residual + length, ACB_SIZE * sizeof(float));
}
@@ -714,7 +714,7 @@ static void frame_erasure(EVRCContext *e, float *samples)
e->pitch[ACB_SIZE + j] = e->energy_vector[i];
}
- memcpy(e->pitch, e->pitch + subframe_size, ACB_SIZE * sizeof(float));
+ memmove(e->pitch, e->pitch + subframe_size, ACB_SIZE * sizeof(float));
if (e->bitrate != RATE_QUANT && e->avg_acb_gain < 0.4) {
f = 0.1 * e->avg_fcb_gain;
@@ -814,7 +814,7 @@ static int evrc_decode_frame(AVCodecContext *avctx, void *data,
interpolate_delay(idelay, delay, e->prev_pitch_delay, i);
acb_excitation(e, e->pitch + ACB_SIZE, e->avg_acb_gain, idelay, subframe_size);
- memcpy(e->pitch, e->pitch + subframe_size, ACB_SIZE * sizeof(float));
+ memmove(e->pitch, e->pitch + subframe_size, ACB_SIZE * sizeof(float));
}
}
@@ -872,7 +872,7 @@ static int evrc_decode_frame(AVCodecContext *avctx, void *data,
e->pitch[ACB_SIZE + j] = e->energy_vector[i];
}
- memcpy(e->pitch, e->pitch + subframe_size, ACB_SIZE * sizeof(float));
+ memmove(e->pitch, e->pitch + subframe_size, ACB_SIZE * sizeof(float));
synthesis_filter(e->pitch + ACB_SIZE, ilpc,
e->synthesis, subframe_size, tmp);