EXA: Fix a couple of logic errors in exaGetPixmapFirstPixel.
The fb pointer would be left uninitialized when exaPixmapIsOffscreen returned false. When it returned true and the pixmap was damaged, fb would be initialized from the pixmap's devPrivate.ptr before the exaDoMigration and exaPrepareAccess calls, at which point devPrivate.ptr would still be pointing at offscreen memory.
This commit is contained in:
		
							parent
							
								
									23fbd5292d
								
							
						
					
					
						commit
						3c448b0eb6
					
				| 
						 | 
					@ -382,19 +382,19 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap)
 | 
				
			||||||
    ExaMigrationRec pixmaps[1];
 | 
					    ExaMigrationRec pixmaps[1];
 | 
				
			||||||
    ExaPixmapPriv (pPixmap);
 | 
					    ExaPixmapPriv (pPixmap);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    fb = pExaPixmap->sys_ptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Try to avoid framebuffer readbacks */
 | 
					    /* Try to avoid framebuffer readbacks */
 | 
				
			||||||
    if (exaPixmapIsOffscreen(pPixmap)) {
 | 
					    if (exaPixmapIsOffscreen(pPixmap) &&
 | 
				
			||||||
	if (!miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0,  &box)) {
 | 
					        miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0,  &box))
 | 
				
			||||||
	    fb = pExaPixmap->sys_ptr;
 | 
					    {
 | 
				
			||||||
	} else {
 | 
						need_finish = TRUE;
 | 
				
			||||||
	    need_finish = TRUE;
 | 
						pixmaps[0].as_dst = FALSE;
 | 
				
			||||||
	    fb = pPixmap->devPrivate.ptr;
 | 
						pixmaps[0].as_src = TRUE;
 | 
				
			||||||
	    pixmaps[0].as_dst = FALSE;
 | 
						pixmaps[0].pPix = pPixmap;
 | 
				
			||||||
	    pixmaps[0].as_src = TRUE;
 | 
						exaDoMigration (pixmaps, 1, FALSE);
 | 
				
			||||||
	    pixmaps[0].pPix = pPixmap;
 | 
						exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
 | 
				
			||||||
	    exaDoMigration (pixmaps, 1, FALSE);
 | 
						fb = pPixmap->devPrivate.ptr;
 | 
				
			||||||
	    exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch (pPixmap->drawable.bitsPerPixel) {
 | 
					    switch (pPixmap->drawable.bitsPerPixel) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue