Commit 879aa062 authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/frame: frame_copy_video: support copying from a smaller to a larger frame

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e868f84e
......@@ -589,8 +589,8 @@ static int frame_copy_video(AVFrame *dst, const AVFrame *src)
const uint8_t *src_data[4];
int i, planes;
if (dst->width != src->width ||
dst->height != src->height)
if (dst->width < src->width ||
dst->height < src->height)
return AVERROR(EINVAL);
planes = av_pix_fmt_count_planes(dst->format);
......@@ -601,7 +601,7 @@ static int frame_copy_video(AVFrame *dst, const AVFrame *src)
memcpy(src_data, src->data, sizeof(src_data));
av_image_copy(dst->data, dst->linesize,
src_data, src->linesize,
dst->format, dst->width, dst->height);
dst->format, src->width, src->height);
return 0;
}
......
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