gallium/vl: do not call transfer_unmap if transfer is NULL

CC: mesa-stable
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6817>
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index 58ddef9..5b5c4df 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -769,7 +769,8 @@
 
    vl_vb_unmap(&buf->vertex_stream, dec->context);
 
-   dec->context->transfer_unmap(dec->context, buf->tex_transfer);
+   if (buf->tex_transfer)
+      dec->context->transfer_unmap(dec->context, buf->tex_transfer);
 
    vb[0] = dec->quads;
    vb[1] = dec->pos;
diff --git a/src/gallium/auxiliary/vl/vl_vertex_buffers.c b/src/gallium/auxiliary/vl/vl_vertex_buffers.c
index 0cf8582..00c424f 100644
--- a/src/gallium/auxiliary/vl/vl_vertex_buffers.c
+++ b/src/gallium/auxiliary/vl/vl_vertex_buffers.c
@@ -352,11 +352,13 @@
    assert(buffer && pipe);
 
    for (i = 0; i < VL_NUM_COMPONENTS; ++i) {
-      pipe_buffer_unmap(pipe, buffer->ycbcr[i].transfer);
+      if (buffer->ycbcr[i].transfer)
+         pipe_buffer_unmap(pipe, buffer->ycbcr[i].transfer);
    }
 
    for (i = 0; i < VL_MAX_REF_FRAMES; ++i) {
-      pipe_buffer_unmap(pipe, buffer->mv[i].transfer);
+      if (buffer->mv[i].transfer)
+         pipe_buffer_unmap(pipe, buffer->mv[i].transfer);
    }
 }