mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
vmncdec: Sanity-check rectangle sizes a bit more thorough
The x/y coordinates could already be bigger than the configured width/height, and adding the rectangle width/height could cause an overflow.
This commit is contained in:
parent
1dbbd4c91e
commit
807e23118b
1 changed files with 2 additions and 1 deletions
|
@ -785,7 +785,8 @@ vmnc_handle_packet (GstVMncDec * dec, const guint8 * data, int len,
|
|||
r.type);
|
||||
return ERROR_INVALID;
|
||||
}
|
||||
if (r.x + r.width > dec->format.width ||
|
||||
if (r.x > dec->format.width || r.y > dec->format.height ||
|
||||
r.x + r.width > dec->format.width ||
|
||||
r.y + r.height > dec->format.height) {
|
||||
GST_WARNING_OBJECT (dec, "Rectangle out of range, type %d", r.type);
|
||||
return ERROR_INVALID;
|
||||
|
|
Loading…
Reference in a new issue