Skip to content
Snippets Groups Projects
Commit 92170669 authored by wm4's avatar wm4 Committed by Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michaelni@gmx.at>
parent 295b79b5
No related branches found
No related tags found
No related merge requests found
......@@ -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;
/* copy prev frame */
for(i = 0; i < height; i++)
memcpy(dst + (i * stride), refdata + (i * stride), width);
if (refdata) {
/* copy prev frame */
for (i = 0; i < height; i++)
memcpy(dst + (i * stride), refdata + (i * stride), width);
} else {
refdata = dst;
}
orig_height = height;
height--;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment