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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-05-31 17:06:26 +02:00
parent e868f84e83
commit 879aa062f9

View File

@ -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;
}