Revision 7cf9c6ae

View differences:

ffplay.c
441 441
    const uint32_t *pal;
442 442
    int dstx, dsty, dstw, dsth;
443 443

  
444
    dstx = FFMIN(FFMAX(rect->x, 0), imgw);
445
    dstw = FFMIN(FFMAX(rect->w, 0), imgw - dstx);
446
    dsty = FFMIN(FFMAX(rect->y, 0), imgh);
447
    dsth = FFMIN(FFMAX(rect->h, 0), imgh - dsty);
444
    dstw = av_clip(rect->w, 0, imgw);
445
    dsth = av_clip(rect->h, 0, imgh);
446
    dstx = av_clip(rect->x, 0, imgw - dstw);
447
    dsty = av_clip(rect->y, 0, imgh - dsth);
448 448
    lum = dst->data[0] + dsty * dst->linesize[0];
449 449
    cb = dst->data[1] + (dsty >> 1) * dst->linesize[1];
450 450
    cr = dst->data[2] + (dsty >> 1) * dst->linesize[2];

Also available in: Unified diff