From da723fd2ddfa549197e5178cd95e48861c01615b Mon Sep 17 00:00:00 2001 From: Calcium Date: Sun, 27 Feb 2005 01:46:24 +0000 Subject: [PATCH] This patch corrects the bug, that if padbottom IS NOT specified and padright IS specified patch by (Calcium ) Originally committed as revision 3987 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 6728ab7fc7..46687f4be0 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -661,15 +661,15 @@ static void fill_pad_region(AVPicture* img, int height, int width, optr = img->data[i] + (img->linesize[i] * (padtop >> shift)) + (img->linesize[i] - (padright >> shift)); - for (y = 0; y < ((height - (padtop + padbottom)) >> shift); y++) { + for (y = 0; y < ((height - (padtop + padbottom) - 1) >> shift); y++) { memset(optr, color[i], (padleft + padright) >> shift); optr += img->linesize[i]; } } - if (padbottom) { - optr = img->data[i] + (img->linesize[i] * ((height - padbottom) >> shift)); - memset(optr, color[i], ((img->linesize[i] * padbottom) >> shift)); + if (padbottom || padright) { + optr = img->data[i] + (((img->linesize[i] * (height - padbottom)) - padright) >> shift); + memset(optr, color[i], (((img->linesize[i] * padbottom) + padright) >> shift)); } } }