Commit bfb2ff3f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XCB/X11: validate scanline pad correctly

parent 7eaf9775
...@@ -179,15 +179,16 @@ static int Open (vlc_object_t *obj) ...@@ -179,15 +179,16 @@ static int Open (vlc_object_t *obj)
continue; continue;
} }
/* VLC pads lines to 16 pixels internally */
if ((fmt->bits_per_pixel << 4) % fmt->scanline_pad)
continue;
/* Byte sex is a non-issue for 8-bits. It can be worked around with /* Byte sex is a non-issue for 8-bits. It can be worked around with
* RGB masks for 24-bits. Too bad for 15-bits and 16-bits. */ * RGB masks for 24-bits. Too bad for 15-bits and 16-bits. */
if (fmt->bits_per_pixel == 16 && setup->image_byte_order != ORDER) if (fmt->bits_per_pixel == 16 && setup->image_byte_order != ORDER)
continue; continue;
/* Make sure the X server is sane */
assert (fmt->bits_per_pixel > 0);
if (unlikely(fmt->scanline_pad % fmt->bits_per_pixel))
continue;
/* Check that the selected screen supports this depth */ /* Check that the selected screen supports this depth */
const xcb_depth_t *d = FindDepth (scr, fmt->depth); const xcb_depth_t *d = FindDepth (scr, fmt->depth);
if (d == NULL) if (d == NULL)
......
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