Skip to content
Commit 02835d57 authored by Markus Armbruster's avatar Markus Armbruster Committed by Michael Roth
Browse files

vnc: Fix tight_detect_smooth_image() for lossless case



VncTight member uint8_t quality is either (uint8_t)-1 for lossless or
less than 10 for lossy.

tight_detect_smooth_image() first promotes it to int, then compares
with -1.  Always unequal, so we always execute the lossy code.  Reads
beyond tight_conf[] and returns crap when quality is actually
lossless.

Compare to (uint8_t)-1 instead, like we do elsewhere.

Spotted by Coverity.

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 2e7bcdb9)
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent 41ee9181
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment