#2 Invalid parameters to crop -> crash

v2.0x
closed-fixed
Richard Berg
Filters (75)
7
2002-07-05
2002-07-04
Richard Berg
No

A rather spectacular one, too. Most buffer errors in
Avisynth don't make VDub dump core, but this one did.

Discussion

  • brad sanders
    brad sanders
    2002-07-04

    Logged In: YES
    user_id=340791

    Ayup, that one's been bugging me, too. Easy enough to add
    this to the next version:

    if (vi.IsYUY2()) {
    // YUY2 can only crop to even pixel boundaries horizontally
    _left = _left & -2;
    _width = (_width+1) & -2;
    } else {
    // RGB is upside-down
    _top = vi.height - _height - _top;
    }
    left_bytes = vi.BytesFromPixels(_left);
    top = _top;
    vi.width = _width; <----replace
    vi.height = _height; <----replace

    vi.width=(vi.width < (_left + _width))? vi.width : _width; <--new
    vi.height=(vi.height < (_top + _height))? vi.height : _height;
    <--new

     
  • Richard Berg
    Richard Berg
    2002-07-05

    • assigned_to: nobody --> richardberg
    • status: open --> closed-fixed
     
  • Richard Berg
    Richard Berg
    2002-07-05

    Logged In: YES
    user_id=495068

    Fixed on CVS. I didn't see your comment until now, but I like
    my way better anyway ;-) Rather than do things behind the
    user's back, I just had a throw an error if (_width > vi.width ||
    _height > vi.height)