for (y = 0; y < ((height - (padtop + padbottom)) >> shift); y++) {
for (y = 0; y < ((height - (padtop + padbottom) - 1) >> shift); y++) {
static void fill_pad_region(AVPicture* img, int height, int width,        int padtop, int padbottom, int padleft, int padright, int *color) {      int i, y, shift;    uint8_t *optr;        for (i = 0; i < 3; i++) {        shift = (i == 0) ? 0 : 1;                if (padtop || padleft) {            memset(img->data[i], color[i], (((img->linesize[i] * padtop) +                             padleft) >> shift));        }        if (padleft || padright) {            optr = img->data[i] + (img->linesize[i] * (padtop >> shift)) +                (img->linesize[i] - (padright >> shift));            for (y = 0; y < ((height - (padtop + padbottom)) >> 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));        }    }}