Number of X colormap entries may be less than 1 << depth

Bug #1903728 reported by Boris Gjenero
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
imlib2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

If I run scrot 1.4-1 to take a screenshot from a MicroVAX with a QDSS display device running ULTRIX 4.5, I get:
X Error of failed request: BadValue (integer parameter out of range for operation)
  Major opcode of failed request: 91 (X_QueryColors)
  Value in failed request: 0xff
  Serial number of failed request: 23
  Current serial number in output stream: 23

The QDSS is an 8 bit PseudoColor device, but it only has 254 available colormap entries, not 256. Here is a fragment from xdpyinfo:
  visual:
    visual id: 0x23
    class: PseudoColor
    depth: 8 planes
    available colormap entries: 254
    red, green, blue masks: 0x0, 0x0, 0x0
    significant bits in color specification: 8 bits

The problem is that in __imlib_GrabDrawableToRGBA(), imlib2 ignores the number of colormap entries and instead does XQueryColors() for all 256 entries, based on the 8 bit depth. The hardware does actually have 256 entries, but the last two are reserved for the hardware cursor, and so the X server denies this XQueryColors() request. The attached patch instead only queries the number of colormap entries based on the visual, and sets the rest of the entries to zero.

ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: libimlib2 1.6.1-2
ProcVersionSignature: Ubuntu 5.8.0-25.26-generic 5.8.14
Uname: Linux 5.8.0-25-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu50
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: XFCE
Date: Tue Nov 10 10:04:44 2020
SourcePackage: imlib2
UpgradeStatus: Upgraded to groovy on 2020-10-22 (19 days ago)

Revision history for this message
Boris Gjenero (boris-gjenero) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix for this issue" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.