Ticket #2305: bmovl-clip.patch

File bmovl-clip.patch, 1.1 KB (added by floemker, 10 years ago)

Patch to correct the check of the incoming rectangle points

  • libmpcodecs/vf_bmovl.c

    old new put_image(struct vf_instance *vf, mp_ima  
    313313                                       vf->priv->x2 = vf->priv->y2 = 0;
    314314                               }
    315315                               // Define how much of our bitmap that contains graphics!
    316                                vf->priv->x1 = av_clip(imgx, 0, vf->priv->x1);
    317                                vf->priv->y1 = av_clip(imgy, 0, vf->priv->y1);
    318                                vf->priv->x2 = av_clip(imgx + imgw, vf->priv->x2, vf->priv->w);
    319                                vf->priv->y2 = av_clip(imgy + imgh, vf->priv->y2, vf->priv->h);
     316                               vf->priv->x1 = av_clip(imgx, 0, vf->priv->w);
     317                               vf->priv->y1 = av_clip(imgy, 0, vf->priv->h);
     318                               vf->priv->x2 = av_clip(imgx + imgw, vf->priv->x1, vf->priv->w);
     319                               vf->priv->y2 = av_clip(imgy + imgh, vf->priv->y1, vf->priv->h);
    320320                       }
    321321
    322322                       if( command == CMD_CLEAR ) {