va: DMA allocator: Set the copied memory properly when popped from pool.
authorHe Junyan <junyan.he@intel.com>
Mon, 22 Nov 2021 08:07:27 +0000 (16:07 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 29 Nov 2021 19:25:31 +0000 (19:25 +0000)
commit7f31dcf0842c5057111174b61b899790afd2f984
treedd3f8bc66900c3a1ee4ffc500bc09c56cb694b3a
parent285695ee52d62a422c31c0da34cedf67822cecb0
va: DMA allocator: Set the copied memory properly when popped from pool.

The current code does not set the copied memory correctly when it is popped
from the surface cache pool.
1. We forget to ref the allocator, which causes the allocator to be freed
   unexpected, and we get a crash later because of the memory violation.
2. We forget to add ref_mems_count, which causes the surface leak because
   the surface can not be pushed back to the cache pool again.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1373>
subprojects/gst-plugins-bad/sys/va/gstvaallocator.c