Commit 32029383 authored by Thiago Santos's avatar Thiago Santos
Browse files

videoscale: vs_image: strides are a gsize

The strides that are set from the GstVideoInfo structs are
a gsize. Using an int can cause overflows when dealing with large
enough images

https://bugzilla.gnome.org/show_bug.cgi?id=731195
parent fb3a9d1b
...@@ -51,7 +51,7 @@ vs_fill_borders_RGBA (const VSImage * dest, const uint8_t * val) ...@@ -51,7 +51,7 @@ vs_fill_borders_RGBA (const VSImage * dest, const uint8_t * val)
int width = dest->width; int width = dest->width;
int height = dest->height; int height = dest->height;
int real_width = dest->real_width; int real_width = dest->real_width;
int stride = dest->stride; gsize stride = dest->stride;
int tmp, tmp2; int tmp, tmp2;
uint8_t *data; uint8_t *data;
uint32_t v = READ_UINT32 (val); uint32_t v = READ_UINT32 (val);
...@@ -103,7 +103,7 @@ vs_fill_borders_RGB (const VSImage * dest, const uint8_t * val) ...@@ -103,7 +103,7 @@ vs_fill_borders_RGB (const VSImage * dest, const uint8_t * val)
int width = dest->width; int width = dest->width;
int height = dest->height; int height = dest->height;
int real_width = dest->real_width; int real_width = dest->real_width;
int stride = dest->stride; gsize stride = dest->stride;
int tmp, tmp2; int tmp, tmp2;
uint8_t *data; uint8_t *data;
...@@ -140,7 +140,7 @@ vs_fill_borders_YUYV (const VSImage * dest, const uint8_t * val) ...@@ -140,7 +140,7 @@ vs_fill_borders_YUYV (const VSImage * dest, const uint8_t * val)
int width = dest->width; int width = dest->width;
int height = dest->height; int height = dest->height;
int real_width = dest->real_width; int real_width = dest->real_width;
int stride = dest->stride; gsize stride = dest->stride;
int tmp, tmp2; int tmp, tmp2;
uint8_t *data; uint8_t *data;
...@@ -189,7 +189,7 @@ vs_fill_borders_UYVY (const VSImage * dest, const uint8_t * val) ...@@ -189,7 +189,7 @@ vs_fill_borders_UYVY (const VSImage * dest, const uint8_t * val)
int width = dest->width; int width = dest->width;
int height = dest->height; int height = dest->height;
int real_width = dest->real_width; int real_width = dest->real_width;
int stride = dest->stride; gsize stride = dest->stride;
int tmp, tmp2; int tmp, tmp2;
uint8_t *data; uint8_t *data;
...@@ -238,7 +238,7 @@ vs_fill_borders_Y (const VSImage * dest, const uint8_t * val) ...@@ -238,7 +238,7 @@ vs_fill_borders_Y (const VSImage * dest, const uint8_t * val)
int width = dest->width; int width = dest->width;
int height = dest->height; int height = dest->height;
int real_width = dest->real_width; int real_width = dest->real_width;
int stride = dest->stride; gsize stride = dest->stride;
int tmp, tmp2; int tmp, tmp2;
uint8_t *data; uint8_t *data;
...@@ -275,7 +275,7 @@ vs_fill_borders_Y16 (const VSImage * dest, const uint16_t val) ...@@ -275,7 +275,7 @@ vs_fill_borders_Y16 (const VSImage * dest, const uint16_t val)
int width = dest->width; int width = dest->width;
int height = dest->height; int height = dest->height;
int real_width = dest->real_width; int real_width = dest->real_width;
int stride = dest->stride; gsize stride = dest->stride;
int tmp, tmp2; int tmp, tmp2;
uint8_t *data; uint8_t *data;
...@@ -312,7 +312,7 @@ vs_fill_borders_RGB565 (const VSImage * dest, const uint8_t * val) ...@@ -312,7 +312,7 @@ vs_fill_borders_RGB565 (const VSImage * dest, const uint8_t * val)
int width = dest->width; int width = dest->width;
int height = dest->height; int height = dest->height;
int real_width = dest->real_width; int real_width = dest->real_width;
int stride = dest->stride; gsize stride = dest->stride;
int tmp, tmp2; int tmp, tmp2;
uint8_t *data; uint8_t *data;
uint16_t v = READ_UINT16 (val); uint16_t v = READ_UINT16 (val);
...@@ -350,7 +350,7 @@ vs_fill_borders_RGB555 (const VSImage * dest, const uint8_t * val) ...@@ -350,7 +350,7 @@ vs_fill_borders_RGB555 (const VSImage * dest, const uint8_t * val)
int width = dest->width; int width = dest->width;
int height = dest->height; int height = dest->height;
int real_width = dest->real_width; int real_width = dest->real_width;
int stride = dest->stride; gsize stride = dest->stride;
int tmp, tmp2; int tmp, tmp2;
uint8_t *data; uint8_t *data;
uint16_t v = READ_UINT16 (val); uint16_t v = READ_UINT16 (val);
...@@ -388,7 +388,7 @@ vs_fill_borders_AYUV64 (const VSImage * dest, const uint8_t * val) ...@@ -388,7 +388,7 @@ vs_fill_borders_AYUV64 (const VSImage * dest, const uint8_t * val)
int width = dest->width; int width = dest->width;
int height = dest->height; int height = dest->height;
int real_width = dest->real_width; int real_width = dest->real_width;
int stride = dest->stride; gsize stride = dest->stride;
int tmp, tmp2; int tmp, tmp2;
uint8_t *data; uint8_t *data;
uint64_t v; uint64_t v;
......
...@@ -42,7 +42,7 @@ struct _VSImage { ...@@ -42,7 +42,7 @@ struct _VSImage {
uint8_t *pixels; uint8_t *pixels;
int width; int width;
int height; int height;
int stride; gsize stride;
}; };
G_GNUC_INTERNAL void vs_image_scale_nearest_RGBA (const VSImage * dest, G_GNUC_INTERNAL void vs_image_scale_nearest_RGBA (const VSImage * dest,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment