Commit 92170669 authored by wm4's avatar wm4 Committed by Michael Niedermayer

qpeg: avoid pointless invalid memcpy()

If refdata was NULL, the memcpy() ended up copying the same memory
block onto itself, which is not only pointless, but also undefined
behavior.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 295b79b5
......@@ -120,12 +120,13 @@ static void av_noinline qpeg_decode_inter(QpegContext *qctx, uint8_t *dst,
int filled = 0;
int orig_height;
if(!refdata)
refdata= dst;
if (refdata) {
/* copy prev frame */
for(i = 0; i < height; i++)
for (i = 0; i < height; i++)
memcpy(dst + (i * stride), refdata + (i * stride), width);
} else {
refdata = dst;
}
orig_height = height;
height--;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment