Public bug reported:

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)

** Affects: imlib2 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug groovy

** Patch added: "Fix for this issue"
   
https://bugs.launchpad.net/bugs/1903728/+attachment/5433042/+files/map_entries_not_depth.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1903728

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/imlib2/+bug/1903728/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to