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)
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
* RGB masks for 24-bits. Too bad for 15-bits and 16-bits. */
if (fmt->bits_per_pixel == 16 && setup->image_byte_order != ORDER)
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 */
const xcb_depth_t *d = FindDepth (scr, fmt->depth);
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