st/xorg: move exaMoveInPixmap before trying to fetch it
authorZack Rusin <zackr@vmware.com>
Mon, 11 Jan 2010 23:27:59 +0000 (18:27 -0500)
committerZack Rusin <zackr@vmware.com>
Mon, 11 Jan 2010 23:27:59 +0000 (18:27 -0500)
as Michel suggested, this is a cleaner way of fixing crashes caused
by exaGetPixmapDriverPrivate returning null since the data hasn't
been moved yet.

src/gallium/state_trackers/xorg/xorg_xv.c

index 666ff10..a437370 100644 (file)
@@ -485,9 +485,12 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id,
    int dxo, dyo;
    Bool hdtv;
    int x, y, w, h;
-   struct exa_pixmap_priv *dst = exaGetPixmapDriverPrivate(pPixmap);
+   struct exa_pixmap_priv *dst;
    struct pipe_surface *dst_surf = NULL;
 
+   exaMoveInPixmap(pPixmap);
+   dst = exaGetPixmapDriverPrivate(pPixmap);
+
    if (dst && !dst->tex) {
        xorg_exa_set_shared_usage(pPixmap);
        pScrn->pScreen->ModifyPixmapHeader(pPixmap, 0, 0, 0, 0, 0, NULL);
@@ -516,7 +519,6 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id,
    bind_samplers(pPriv);
    setup_fs_video_constants(pPriv->r, hdtv);
 
-   exaMoveInPixmap(pPixmap);
    DamageDamageRegion(&pPixmap->drawable, dstRegion);
 
    while (nbox--) {