From 85ddf3070c3240eae9bf076fde259daa91838081 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 27 Apr 2016 18:34:24 +0200 Subject: cfhd: Simplify memcpy expressions --- libavcodec/cfhd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index 9a3bb38656..7e2dec1b27 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -480,8 +480,8 @@ static int read_lowpass_coeffs(AVCodecContext *avctx, CFHDContext *s, /* Copy last coefficients line if height is odd. */ if (lowpass_height & 1) { - memcpy(&coeff_data[lowpass_height * lowpass_width], - &coeff_data[(lowpass_height - 1) * lowpass_width], + int16_t *last_line = &coeff_data[lowpass_height * lowpass_width]; + memcpy(last_line, &last_line[-lowpass_width], lowpass_width * sizeof(*coeff_data)); } @@ -582,8 +582,8 @@ static int read_highpass_coeffs(AVCodecContext *avctx, CFHDContext *s, /* Copy last line of coefficients if height is odd. */ if (highpass_height & 1) { - memcpy(&coeff_data[ highpass_height * highpass_stride], - &coeff_data[(highpass_height - 1) * highpass_stride], + int16_t *last_line = &coeff_data[expected]; + memcpy(last_line, &last_line[-highpass_stride], highpass_stride * sizeof(*coeff_data)); } -- cgit v1.2.3