• Sandy Stutsman's avatar
    Do not allow duplicate IDs in video mode info buffer. · 7ee27e89
    Sandy Stutsman authored
    Modes are returned in a buffer from qemu with IDs in increasing but not
    necessarily consecutive order. (Some modes may be omitted if they don't fit
    into the framebuffer.) Two custom modes are appended to the local buffer to
    support arbitrary resolutions. The first custom id must be set to +1 of the
    last id in the mode buffer, not to the last index +1 of the buffer.
    
    E.G. these are the last entries in the mode buffer returned from QEMU:
    	Index      Mode id (unfortunately named ModeIndex in the struct)
    	...
    	124         128
    	125         130
    	126         132
    	127         134 (last mode returned from QEMU)
    
    Custom Modes:
    	128         135 (Not 128!)
    	129         136
    
    If the first custom mode id is set to 128 (the number of modes returned
    from QEMU), it will duplicate the id for the mode at index 124. That could
    cause the FindMode function which searches the mode list by mode id
    to return the wrong mode information.
    
    The custom mode id's are now set to be greater than the last mode id
    returned from QEMU.
    
    The last argument in the FillVidModeInfo is replaced with the actual mode
    id rather than the index.  This does nothing more than replace the mode id
    with itself.
    
    This addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1202424
    
    ---
    Updated the comments
    ---
    7ee27e89
Name
Last commit
Last update
spice-protocol @ 26cd1946
wddm Loading commit data...
xddm Loading commit data...
.gitmodules Loading commit data...