summaryrefslogtreecommitdiff
path: root/gst/vmnc
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-12-06 07:58:25 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-12-06 07:59:51 +0200
commit807e23118b6b6d99e61b5e2055c4bc82a444b008 (patch)
treea1189a0ef426ed29f3400abc4e709155d6832584 /gst/vmnc
parent1dbbd4c91e5313fad1ff9e8c7c77ec2287feb3d8 (diff)
downloadgstreamer-plugins-bad-807e23118b6b6d99e61b5e2055c4bc82a444b008.tar.gz
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.
Diffstat (limited to 'gst/vmnc')
-rw-r--r--gst/vmnc/vmncdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gst/vmnc/vmncdec.c b/gst/vmnc/vmncdec.c
index b3c977883..cbbaeb6b4 100644
--- a/gst/vmnc/vmncdec.c
+++ b/gst/vmnc/vmncdec.c
@@ -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;