mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
295b79b5d8
commit
921706691a
@ -120,12 +120,13 @@ static void av_noinline qpeg_decode_inter(QpegContext *qctx, uint8_t *dst,
|
|||||||
int filled = 0;
|
int filled = 0;
|
||||||
int orig_height;
|
int orig_height;
|
||||||
|
|
||||||
if(!refdata)
|
if (refdata) {
|
||||||
refdata= dst;
|
/* copy prev frame */
|
||||||
|
for (i = 0; i < height; i++)
|
||||||
/* copy prev frame */
|
memcpy(dst + (i * stride), refdata + (i * stride), width);
|
||||||
for(i = 0; i < height; i++)
|
} else {
|
||||||
memcpy(dst + (i * stride), refdata + (i * stride), width);
|
refdata = dst;
|
||||||
|
}
|
||||||
|
|
||||||
orig_height = height;
|
orig_height = height;
|
||||||
height--;
|
height--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user