glamor: Propagate glamor_fds_from_pixmap error in glamor_fd_from_pixmap
glamor_fds_from_pixmap returns 0 on error, but we were treating that as
success, continuing with uninitialized stride and fd values.
Also bail if the offset isn't 0, same as in dri3_fd_from_pixmap.
v2:
* Reduce to a simple one-liner fix (Emil Velikov)
Fixes: c8c276c956
"glamor: Implement PixmapFromBuffers and
BuffersFromPixmap"
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
parent
3da999a039
commit
4d5950ce14
|
@ -865,7 +865,7 @@ glamor_fd_from_pixmap(ScreenPtr screen,
|
||||||
&modifier);
|
&modifier);
|
||||||
|
|
||||||
/* Pixmaps with multi-planes/modifier are not supported in this interface */
|
/* Pixmaps with multi-planes/modifier are not supported in this interface */
|
||||||
if (ret > 1) {
|
if (ret != 1 || offsets[0] != 0) {
|
||||||
while (ret > 0)
|
while (ret > 0)
|
||||||
close(fds[--ret]);
|
close(fds[--ret]);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue