==1308== Memcheck, a memory error detector
==1308== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==1308== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==1308== Command: ./vaapi_test 10
==1308== 
0:00:12.886757416  1308     0x187e2e00 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x19674a50
0:00:14.904811386  1308      0x9baf5a0 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x9f680d0
0:00:16.487930084  1308      0x9dcec30 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0xa2dc500
0:00:16.950570592  1308      0xa150500 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0xa181ba0
0:00:19.936362802  1308      0x9baaa50 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x17a494b0
0:00:23.836187773  1308      0x9d5d1b0 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0xa09d5f0
0:00:27.278365451  1308      0x9cd3510 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x192b34b0
==1308== Thread 20 videotestsrc5:sr:
==1308== Invalid write of size 4
==1308==    at 0xE8113FB: handleVAEncPictureParameterBufferType (picture.c:430)
==1308==    by 0xE8113FB: vlVaRenderPicture (picture.c:541)
==1308==    by 0xA5D388A: do_encode (gstvaapiencoder_objects.c:491)
==1308==    by 0xA5D3F74: gst_vaapi_enc_picture_encode (gstvaapiencoder_objects.c:560)
==1308==    by 0xA5CDF07: gst_vaapi_encoder_h264_encode (gstvaapiencoder_h264.c:2581)
==1308==    by 0xA5C49C8: gst_vaapi_encoder_put_frame (gstvaapiencoder.c:407)
==1308==    by 0xA595EC9: gst_vaapiencode_handle_frame (gstvaapiencode.c:643)
==1308==    by 0x8294C1E: gst_video_encoder_chain (gstvideoencoder.c:1438)
==1308==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1308==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1308==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1308==    by 0x6E111F9: gst_base_transform_chain (gstbasetransform.c:2312)
==1308==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1308==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1308==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1308==  Address 0x188dbcc0 is 0 bytes inside a block of size 32 free'd
==1308==    at 0x4C2CDDB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1308==    by 0x5A74BD4: ptr_array_free (garray.c:1112)
==1308==    by 0xA5D3661: gst_vaapi_enc_slice_destroy (gstvaapiencoder_objects.c:160)
==1308==    by 0xA5B3D2D: gst_vaapi_mini_object_free (gstvaapiminiobject.c:39)
==1308==    by 0x5A74B5A: g_ptr_array_foreach (garray.c:1511)
==1308==    by 0x5A74BEF: ptr_array_free (garray.c:1097)
==1308==    by 0xA5D36CD: gst_vaapi_enc_picture_destroy (gstvaapiencoder_objects.c:345)
==1308==    by 0xA5B3D2D: gst_vaapi_mini_object_free (gstvaapiminiobject.c:39)
==1308==    by 0xA5C40F0: coded_buffer_proxy_set_user_data (gstvaapicodedbufferproxy.c:36)
==1308==    by 0xA5C40F0: gst_vaapi_coded_buffer_proxy_set_user_data (gstvaapicodedbufferproxy.c:255)
==1308==    by 0xA5C4C16: gst_vaapi_encoder_get_buffer_with_timeout (gstvaapiencoder.c:476)
==1308==    by 0xA595433: gst_vaapiencode_push_frame (gstvaapiencode.c:275)
==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
==1308==  Block was alloc'd at
==1308==    at 0x4C2BBAF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1308==    by 0x5AA6028: g_malloc (gmem.c:94)
==1308==    by 0x5ABE462: g_slice_alloc (gslice.c:1025)
==1308==    by 0x5A74340: g_ptr_array_sized_new (garray.c:909)
==1308==    by 0x5A743DD: g_ptr_array_new_with_free_func (garray.c:942)
==1308==    by 0xA5D39AB: gst_vaapi_enc_slice_create (gstvaapiencoder_objects.c:182)
==1308==    by 0xA5994E4: gst_vaapi_codec_object_create (gstvaapicodec_objects.c:63)
==1308==    by 0xA5994E4: gst_vaapi_codec_object_new (gstvaapicodec_objects.c:93)
==1308==    by 0xA5D3AAF: gst_vaapi_enc_slice_new (gstvaapiencoder_objects.c:196)
==1308==    by 0xA5C9378: add_slice_headers (gstvaapiencoder_h264.c:2030)
==1308==    by 0xA5C9378: ensure_slices (gstvaapiencoder_h264.c:2384)
==1308==    by 0xA5CDEF7: gst_vaapi_encoder_h264_encode (gstvaapiencoder_h264.c:2579)
==1308==    by 0xA5C49C8: gst_vaapi_encoder_put_frame (gstvaapiencoder.c:407)
==1308==    by 0xA595EC9: gst_vaapiencode_handle_frame (gstvaapiencode.c:643)
==1308== 
0:00:30.406124687  1308      0x9e5a980 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x17cc2230
0:00:31.240374082  1308      0xa234a70 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x194a8b20
==1308== Invalid read of size 4
==1308==    at 0xE811352: handleVAEncSliceParameterBufferType (picture.c:458)
==1308==    by 0xE811352: vlVaRenderPicture (picture.c:545)
==1308==    by 0xA5D388A: do_encode (gstvaapiencoder_objects.c:491)
==1308==    by 0xA5D400E: gst_vaapi_enc_picture_encode (gstvaapiencoder_objects.c:577)
==1308==    by 0xA5CDF07: gst_vaapi_encoder_h264_encode (gstvaapiencoder_h264.c:2581)
==1308==    by 0xA5C49C8: gst_vaapi_encoder_put_frame (gstvaapiencoder.c:407)
==1308==    by 0xA595EC9: gst_vaapiencode_handle_frame (gstvaapiencode.c:643)
==1308==    by 0x8294C1E: gst_video_encoder_chain (gstvideoencoder.c:1438)
==1308==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1308==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1308==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1308==    by 0x6E111F9: gst_base_transform_chain (gstbasetransform.c:2312)
==1308==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1308==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1308==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1308==  Address 0x188dbcc0 is 0 bytes inside a block of size 32 free'd
==1308==    at 0x4C2CDDB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1308==    by 0x5A74BD4: ptr_array_free (garray.c:1112)
==1308==    by 0xA5D3661: gst_vaapi_enc_slice_destroy (gstvaapiencoder_objects.c:160)
==1308==    by 0xA5B3D2D: gst_vaapi_mini_object_free (gstvaapiminiobject.c:39)
==1308==    by 0x5A74B5A: g_ptr_array_foreach (garray.c:1511)
==1308==    by 0x5A74BEF: ptr_array_free (garray.c:1097)
==1308==    by 0xA5D36CD: gst_vaapi_enc_picture_destroy (gstvaapiencoder_objects.c:345)
==1308==    by 0xA5B3D2D: gst_vaapi_mini_object_free (gstvaapiminiobject.c:39)
==1308==    by 0xA5C40F0: coded_buffer_proxy_set_user_data (gstvaapicodedbufferproxy.c:36)
==1308==    by 0xA5C40F0: gst_vaapi_coded_buffer_proxy_set_user_data (gstvaapicodedbufferproxy.c:255)
==1308==    by 0xA5C4C16: gst_vaapi_encoder_get_buffer_with_timeout (gstvaapiencoder.c:476)
==1308==    by 0xA595433: gst_vaapiencode_push_frame (gstvaapiencode.c:275)
==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
==1308==  Block was alloc'd at
==1308==    at 0x4C2BBAF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1308==    by 0x5AA6028: g_malloc (gmem.c:94)
==1308==    by 0x5ABE462: g_slice_alloc (gslice.c:1025)
==1308==    by 0x5A74340: g_ptr_array_sized_new (garray.c:909)
==1308==    by 0x5A743DD: g_ptr_array_new_with_free_func (garray.c:942)
==1308==    by 0xA5D39AB: gst_vaapi_enc_slice_create (gstvaapiencoder_objects.c:182)
==1308==    by 0xA5994E4: gst_vaapi_codec_object_create (gstvaapicodec_objects.c:63)
==1308==    by 0xA5994E4: gst_vaapi_codec_object_new (gstvaapicodec_objects.c:93)
==1308==    by 0xA5D3AAF: gst_vaapi_enc_slice_new (gstvaapiencoder_objects.c:196)
==1308==    by 0xA5C9378: add_slice_headers (gstvaapiencoder_h264.c:2030)
==1308==    by 0xA5C9378: ensure_slices (gstvaapiencoder_h264.c:2384)
==1308==    by 0xA5CDEF7: gst_vaapi_encoder_h264_encode (gstvaapiencoder_h264.c:2579)
==1308==    by 0xA5C49C8: gst_vaapi_encoder_put_frame (gstvaapiencoder.c:407)
==1308==    by 0xA595EC9: gst_vaapiencode_handle_frame (gstvaapiencode.c:643)
==1308== 
0:00:49.076530707  1308      0x9f24f10 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x9cb6fe0

valgrind: m_mallocfree.c:303 (get_bszB_as_is): Assertion 'bszB_lo == bszB_hi' failed.
valgrind: Heap block lo/hi size mismatch: lo = 7, hi = 458752.
This is probably caused by your program erroneously writing past the
end of a heap block and corrupting heap metadata.  If you fix any
invalid writes reported by Memcheck, this assertion failure will
probably go away.  Please try that before reporting this as a bug.


host stacktrace:
==1308==    at 0x38089EAA: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0x38089FC4: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0x3808A15A: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0x380994FA: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0x3805275F: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0x3805293B: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0x38052ADA: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0x380E25E3: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0x380F18E0: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0x380F1E1A: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0x3811C57D: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==1308==    by 0xDEADBEEFDEADBEEE: ???
==1308==    by 0xDEADBEEFDEADBEEE: ???
==1308==    by 0xDEADBEEFDEADBEEE: ???

sched status:
  running_tid=20

  Thread 1: status = VgTs_WaitSys (lwpid 1308)
  ==1308==    at 0x690263D: ??? (syscall-template.S:84)
  ==1308==    by 0x5AA0C15: g_main_context_poll (gmain.c:4271)
  ==1308==    by 0x5AA0C15: g_main_context_iterate.isra.30 (gmain.c:3967)
  ==1308==    by 0x5AA0FA1: g_main_loop_run (gmain.c:4168)
  ==1308==    by 0x108C54: main (main.cpp:41)

  Thread 2: status = VgTs_WaitSys (lwpid 1333)
  ==1308==    at 0x5D7715F: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
  ==1308==    by 0xE91DFDA: cnd_wait (threads_posix.h:159)
  ==1308==    by 0xE91DFDA: util_queue_thread_func (u_queue.c:158)
  ==1308==    by 0xE91DF06: impl_thrd_routine (threads_posix.h:87)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 3: status = VgTs_WaitSys (lwpid 1334)
  ==1308==    at 0x5D7715F: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
  ==1308==    by 0xE91DFDA: cnd_wait (threads_posix.h:159)
  ==1308==    by 0xE91DFDA: util_queue_thread_func (u_queue.c:158)
  ==1308==    by 0xE91DF06: impl_thrd_routine (threads_posix.h:87)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 4: status = VgTs_WaitSys (lwpid 1335)
  ==1308==    at 0x5D7715F: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
  ==1308==    by 0xE91DFDA: cnd_wait (threads_posix.h:159)
  ==1308==    by 0xE91DFDA: util_queue_thread_func (u_queue.c:158)
  ==1308==    by 0xE91DF06: impl_thrd_routine (threads_posix.h:87)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 5: status = VgTs_WaitSys (lwpid 1336)
  ==1308==    at 0x5D7715F: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
  ==1308==    by 0xE91DFDA: cnd_wait (threads_posix.h:159)
  ==1308==    by 0xE91DFDA: util_queue_thread_func (u_queue.c:158)
  ==1308==    by 0xE91DF06: impl_thrd_routine (threads_posix.h:87)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 6: status = VgTs_WaitSys (lwpid 1337)
  ==1308==    at 0x5D7715F: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
  ==1308==    by 0xE91DFDA: cnd_wait (threads_posix.h:159)
  ==1308==    by 0xE91DFDA: util_queue_thread_func (u_queue.c:158)
  ==1308==    by 0xE91DF06: impl_thrd_routine (threads_posix.h:87)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 7: status = VgTs_WaitSys (lwpid 1338)
  ==1308==    at 0x5D7715F: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
  ==1308==    by 0xE91DFDA: cnd_wait (threads_posix.h:159)
  ==1308==    by 0xE91DFDA: util_queue_thread_func (u_queue.c:158)
  ==1308==    by 0xE91DF06: impl_thrd_routine (threads_posix.h:87)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 8: status = VgTs_WaitSys (lwpid 1339)
  ==1308==    at 0x5D7715F: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
  ==1308==    by 0xE91DFDA: cnd_wait (threads_posix.h:159)
  ==1308==    by 0xE91DFDA: util_queue_thread_func (u_queue.c:158)
  ==1308==    by 0xE91DF06: impl_thrd_routine (threads_posix.h:87)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 9: status = VgTs_WaitSys (lwpid 1340)
  ==1308==    at 0x5D7715F: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
  ==1308==    by 0xE91DFDA: cnd_wait (threads_posix.h:159)
  ==1308==    by 0xE91DFDA: util_queue_thread_func (u_queue.c:158)
  ==1308==    by 0xE91DF06: impl_thrd_routine (threads_posix.h:87)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 10: status = VgTs_WaitSys (lwpid 1341)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B2493: _gst_vaapi_image_map (gstvaapiimage.c:553)
  ==1308==    by 0xA5932CB: map_vaapi_memory (gstvaapivideomemory.c:250)
  ==1308==    by 0xA5932CB: gst_video_meta_map_vaapi_memory (gstvaapivideomemory.c:326)
  ==1308==    by 0x827BB35: gst_video_frame_map_id (video-frame.c:103)
  ==1308==    by 0xA3662AE: gst_video_test_src_fill (gstvideotestsrc.c:1143)
  ==1308==    by 0x6E0578E: gst_base_src_default_create (gstbasesrc.c:1514)
  ==1308==    by 0x6E07CBF: gst_base_src_get_range (gstbasesrc.c:2499)
  ==1308==    by 0x6E09DEA: gst_base_src_loop (gstbasesrc.c:2799)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 11: status = VgTs_WaitSys (lwpid 1342)
  ==1308==    at 0x69071E9: syscall (syscall.S:38)
  ==1308==    by 0x5AE66F9: g_cond_wait_until (gthread-posix.c:1442)
  ==1308==    by 0x5A74F48: g_async_queue_pop_intern_unlocked (gasyncqueue.c:422)
  ==1308==    by 0x5A7556B: g_async_queue_timeout_pop (gasyncqueue.c:543)
  ==1308==    by 0xA5C4BD5: gst_vaapi_encoder_get_buffer_with_timeout (gstvaapiencoder.c:467)
  ==1308==    by 0xA595433: gst_vaapiencode_push_frame (gstvaapiencode.c:275)
  ==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 12: status = VgTs_WaitSys (lwpid 1343)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B5B44: gst_vaapi_surface_create_full (gstvaapisurface.c:200)
  ==1308==    by 0xA5B5B44: gst_vaapi_surface_new_full (gstvaapisurface.c:382)
  ==1308==    by 0xA5B6FEF: gst_vaapi_surface_pool_alloc_object (gstvaapisurfacepool.c:80)
  ==1308==    by 0xA5BA9F0: gst_vaapi_video_pool_alloc_object (gstvaapivideopool.c:55)
  ==1308==    by 0xA5BA9F0: gst_vaapi_video_pool_get_object_unlocked (gstvaapivideopool.c:181)
  ==1308==    by 0xA5BA9F0: gst_vaapi_video_pool_get_object (gstvaapivideopool.c:200)
  ==1308==    by 0xA5B7502: gst_vaapi_surface_proxy_new_from_pool (gstvaapisurfaceproxy.c:139)
  ==1308==    by 0xA5933F4: new_surface_proxy (gstvaapivideomemory.c:196)
  ==1308==    by 0xA5933F4: ensure_surface (gstvaapivideomemory.c:208)
  ==1308==    by 0xA5933F4: map_vaapi_memory (gstvaapivideomemory.c:240)
  ==1308==    by 0xA5933F4: gst_video_meta_map_vaapi_memory (gstvaapivideomemory.c:326)
  ==1308==    by 0x827BB35: gst_video_frame_map_id (video-frame.c:103)
  ==1308==    by 0xA3662AE: gst_video_test_src_fill (gstvideotestsrc.c:1143)
  ==1308==    by 0x6E0578E: gst_base_src_default_create (gstbasesrc.c:1514)
  ==1308==    by 0x6E07CBF: gst_base_src_get_range (gstbasesrc.c:2499)
  ==1308==    by 0x6E09DEA: gst_base_src_loop (gstbasesrc.c:2799)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 13: status = VgTs_WaitSys (lwpid 1344)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B21BE: _gst_vaapi_image_unmap (gstvaapiimage.c:606)
  ==1308==    by 0xA593713: unmap_vaapi_memory (gstvaapivideomemory.c:292)
  ==1308==    by 0xA593713: gst_video_meta_unmap_vaapi_memory (gstvaapivideomemory.c:371)
  ==1308==    by 0x827BF6C: gst_video_frame_unmap (video-frame.c:264)
  ==1308==    by 0xA366416: gst_video_test_src_fill (gstvideotestsrc.c:1159)
  ==1308==    by 0x6E0578E: gst_base_src_default_create (gstbasesrc.c:1514)
  ==1308==    by 0x6E07CBF: gst_base_src_get_range (gstbasesrc.c:2499)
  ==1308==    by 0x6E09DEA: gst_base_src_loop (gstbasesrc.c:2799)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 14: status = VgTs_WaitSys (lwpid 1345)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B21BE: _gst_vaapi_image_unmap (gstvaapiimage.c:606)
  ==1308==    by 0xA593713: unmap_vaapi_memory (gstvaapivideomemory.c:292)
  ==1308==    by 0xA593713: gst_video_meta_unmap_vaapi_memory (gstvaapivideomemory.c:371)
  ==1308==    by 0x827BF6C: gst_video_frame_unmap (video-frame.c:264)
  ==1308==    by 0xA366416: gst_video_test_src_fill (gstvideotestsrc.c:1159)
  ==1308==    by 0x6E0578E: gst_base_src_default_create (gstbasesrc.c:1514)
  ==1308==    by 0x6E07CBF: gst_base_src_get_range (gstbasesrc.c:2499)
  ==1308==    by 0x6E09DEA: gst_base_src_loop (gstbasesrc.c:2799)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 15: status = VgTs_WaitSys (lwpid 1346)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5C37EB: coded_buffer_unmap (gstvaapicodedbuffer.c:90)
  ==1308==    by 0xA5C3BA5: gst_vaapi_coded_buffer_get_size (gstvaapicodedbuffer.c:201)
  ==1308==    by 0xA594F9C: gst_vaapiencode_default_alloc_buffer (gstvaapiencode.c:196)
  ==1308==    by 0xA596BF7: gst_vaapiencode_h264_alloc_buffer (gstvaapiencode_h264.c:611)
  ==1308==    by 0xA595549: gst_vaapiencode_push_frame (gstvaapiencode.c:296)
  ==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 16: status = VgTs_WaitSys (lwpid 1347)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B2493: _gst_vaapi_image_map (gstvaapiimage.c:553)
  ==1308==    by 0xA5932CB: map_vaapi_memory (gstvaapivideomemory.c:250)
  ==1308==    by 0xA5932CB: gst_video_meta_map_vaapi_memory (gstvaapivideomemory.c:326)
  ==1308==    by 0x827BB35: gst_video_frame_map_id (video-frame.c:103)
  ==1308==    by 0xA3662AE: gst_video_test_src_fill (gstvideotestsrc.c:1143)
  ==1308==    by 0x6E0578E: gst_base_src_default_create (gstbasesrc.c:1514)
  ==1308==    by 0x6E07CBF: gst_base_src_get_range (gstbasesrc.c:2499)
  ==1308==    by 0x6E09DEA: gst_base_src_loop (gstbasesrc.c:2799)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 17: status = VgTs_WaitSys (lwpid 1348)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B69B1: gst_vaapi_surface_sync (gstvaapisurface.c:935)
  ==1308==    by 0xA5C4BF6: gst_vaapi_encoder_get_buffer_with_timeout (gstvaapiencoder.c:473)
  ==1308==    by 0xA595433: gst_vaapiencode_push_frame (gstvaapiencode.c:275)
  ==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 18: status = VgTs_WaitSys (lwpid 1349)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B69B1: gst_vaapi_surface_sync (gstvaapisurface.c:935)
  ==1308==    by 0xA5C4BF6: gst_vaapi_encoder_get_buffer_with_timeout (gstvaapiencoder.c:473)
  ==1308==    by 0xA595433: gst_vaapiencode_push_frame (gstvaapiencode.c:275)
  ==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 19: status = VgTs_WaitSys (lwpid 1350)
  ==1308==    at 0x69071E9: syscall (syscall.S:38)
  ==1308==    by 0x5AE66F9: g_cond_wait_until (gthread-posix.c:1442)
  ==1308==    by 0x5A74F48: g_async_queue_pop_intern_unlocked (gasyncqueue.c:422)
  ==1308==    by 0x5A7556B: g_async_queue_timeout_pop (gasyncqueue.c:543)
  ==1308==    by 0xA5C4BD5: gst_vaapi_encoder_get_buffer_with_timeout (gstvaapiencoder.c:467)
  ==1308==    by 0xA595433: gst_vaapiencode_push_frame (gstvaapiencode.c:275)
  ==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 20: status = VgTs_Runnable (lwpid 1351)
  ==1308==    at 0x4C2BBAF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==1308==    by 0x5AA6028: g_malloc (gmem.c:94)
  ==1308==    by 0x5ABE462: g_slice_alloc (gslice.c:1025)
  ==1308==    by 0x5ABEA8D: g_slice_alloc0 (gslice.c:1051)
  ==1308==    by 0x8294AAF: gst_video_encoder_new_frame (gstvideoencoder.c:1296)
  ==1308==    by 0x8294AAF: gst_video_encoder_chain (gstvideoencoder.c:1383)
  ==1308==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
  ==1308==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
  ==1308==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
  ==1308==    by 0x6E111F9: gst_base_transform_chain (gstbasetransform.c:2312)
  ==1308==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
  ==1308==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
  ==1308==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
  ==1308==    by 0x6E0A274: gst_base_src_loop (gstbasesrc.c:2913)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 21: status = VgTs_WaitSys (lwpid 1352)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B2493: _gst_vaapi_image_map (gstvaapiimage.c:553)
  ==1308==    by 0xA5932CB: map_vaapi_memory (gstvaapivideomemory.c:250)
  ==1308==    by 0xA5932CB: gst_video_meta_map_vaapi_memory (gstvaapivideomemory.c:326)
  ==1308==    by 0x827BB35: gst_video_frame_map_id (video-frame.c:103)
  ==1308==    by 0xA3662AE: gst_video_test_src_fill (gstvideotestsrc.c:1143)
  ==1308==    by 0x6E0578E: gst_base_src_default_create (gstbasesrc.c:1514)
  ==1308==    by 0x6E07CBF: gst_base_src_get_range (gstbasesrc.c:2499)
  ==1308==    by 0x6E09DEA: gst_base_src_loop (gstbasesrc.c:2799)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 22: status = VgTs_WaitSys (lwpid 1353)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B2493: _gst_vaapi_image_map (gstvaapiimage.c:553)
  ==1308==    by 0xA5932CB: map_vaapi_memory (gstvaapivideomemory.c:250)
  ==1308==    by 0xA5932CB: gst_video_meta_map_vaapi_memory (gstvaapivideomemory.c:326)
  ==1308==    by 0x827BB35: gst_video_frame_map_id (video-frame.c:103)
  ==1308==    by 0xA3662AE: gst_video_test_src_fill (gstvideotestsrc.c:1143)
  ==1308==    by 0x6E0578E: gst_base_src_default_create (gstbasesrc.c:1514)
  ==1308==    by 0x6E07CBF: gst_base_src_get_range (gstbasesrc.c:2499)
  ==1308==    by 0x6E09DEA: gst_base_src_loop (gstbasesrc.c:2799)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 23: status = VgTs_WaitSys (lwpid 1358)
  ==1308==    at 0x69071E9: syscall (syscall.S:38)
  ==1308==    by 0x5AE66F9: g_cond_wait_until (gthread-posix.c:1442)
  ==1308==    by 0x5A74F48: g_async_queue_pop_intern_unlocked (gasyncqueue.c:422)
  ==1308==    by 0x5A7556B: g_async_queue_timeout_pop (gasyncqueue.c:543)
  ==1308==    by 0xA5C4BD5: gst_vaapi_encoder_get_buffer_with_timeout (gstvaapiencoder.c:467)
  ==1308==    by 0xA595433: gst_vaapiencode_push_frame (gstvaapiencode.c:275)
  ==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 24: status = VgTs_WaitSys (lwpid 1359)
  ==1308==    at 0x69071E9: syscall (syscall.S:38)
  ==1308==    by 0x5AE66F9: g_cond_wait_until (gthread-posix.c:1442)
  ==1308==    by 0x5A74F48: g_async_queue_pop_intern_unlocked (gasyncqueue.c:422)
  ==1308==    by 0x5A7556B: g_async_queue_timeout_pop (gasyncqueue.c:543)
  ==1308==    by 0xA5C4BD5: gst_vaapi_encoder_get_buffer_with_timeout (gstvaapiencoder.c:467)
  ==1308==    by 0xA595433: gst_vaapiencode_push_frame (gstvaapiencode.c:275)
  ==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 25: status = VgTs_WaitSys (lwpid 1360)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B21BE: _gst_vaapi_image_unmap (gstvaapiimage.c:606)
  ==1308==    by 0xA593713: unmap_vaapi_memory (gstvaapivideomemory.c:292)
  ==1308==    by 0xA593713: gst_video_meta_unmap_vaapi_memory (gstvaapivideomemory.c:371)
  ==1308==    by 0x827BF6C: gst_video_frame_unmap (video-frame.c:264)
  ==1308==    by 0xA366416: gst_video_test_src_fill (gstvideotestsrc.c:1159)
  ==1308==    by 0x6E0578E: gst_base_src_default_create (gstbasesrc.c:1514)
  ==1308==    by 0x6E07CBF: gst_base_src_get_range (gstbasesrc.c:2499)
  ==1308==    by 0x6E09DEA: gst_base_src_loop (gstbasesrc.c:2799)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 26: status = VgTs_WaitSys (lwpid 1361)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5C3854: coded_buffer_map.part.0 (gstvaapicodedbuffer.c:77)
  ==1308==    by 0xA5C3BBE: coded_buffer_map (gstvaapicodedbuffer.c:195)
  ==1308==    by 0xA5C3BBE: gst_vaapi_coded_buffer_get_size (gstvaapicodedbuffer.c:194)
  ==1308==    by 0xA594F9C: gst_vaapiencode_default_alloc_buffer (gstvaapiencode.c:196)
  ==1308==    by 0xA596BF7: gst_vaapiencode_h264_alloc_buffer (gstvaapiencode_h264.c:611)
  ==1308==    by 0xA595549: gst_vaapiencode_push_frame (gstvaapiencode.c:296)
  ==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 27: status = VgTs_WaitSys (lwpid 1362)
  ==1308==    at 0x69071E9: syscall (syscall.S:38)
  ==1308==    by 0x5AE66F9: g_cond_wait_until (gthread-posix.c:1442)
  ==1308==    by 0x5A74F48: g_async_queue_pop_intern_unlocked (gasyncqueue.c:422)
  ==1308==    by 0x5A7556B: g_async_queue_timeout_pop (gasyncqueue.c:543)
  ==1308==    by 0xA5C4BD5: gst_vaapi_encoder_get_buffer_with_timeout (gstvaapiencoder.c:467)
  ==1308==    by 0xA595433: gst_vaapiencode_push_frame (gstvaapiencode.c:275)
  ==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 28: status = VgTs_WaitSys (lwpid 1363)
  ==1308==    at 0x69071E9: syscall (syscall.S:38)
  ==1308==    by 0x5AE66F9: g_cond_wait_until (gthread-posix.c:1442)
  ==1308==    by 0x5A74F48: g_async_queue_pop_intern_unlocked (gasyncqueue.c:422)
  ==1308==    by 0x5A7556B: g_async_queue_timeout_pop (gasyncqueue.c:543)
  ==1308==    by 0xA5C4BD5: gst_vaapi_encoder_get_buffer_with_timeout (gstvaapiencoder.c:467)
  ==1308==    by 0xA595433: gst_vaapiencode_push_frame (gstvaapiencode.c:275)
  ==1308==    by 0xA59583D: gst_vaapiencode_buffer_loop (gstvaapiencode.c:341)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)

  Thread 29: status = VgTs_WaitSys (lwpid 1364)
  ==1308==    at 0x5D79F5C: __lll_lock_wait (lowlevellock.S:135)
  ==1308==    by 0x5D73C05: pthread_mutex_lock (pthread_mutex_lock.c:115)
  ==1308==    by 0xA5B21BE: _gst_vaapi_image_unmap (gstvaapiimage.c:606)
  ==1308==    by 0xA593713: unmap_vaapi_memory (gstvaapivideomemory.c:292)
  ==1308==    by 0xA593713: gst_video_meta_unmap_vaapi_memory (gstvaapivideomemory.c:371)
  ==1308==    by 0x827BF6C: gst_video_frame_unmap (video-frame.c:264)
  ==1308==    by 0xA366416: gst_video_test_src_fill (gstvideotestsrc.c:1159)
  ==1308==    by 0x6E0578E: gst_base_src_default_create (gstbasesrc.c:1514)
  ==1308==    by 0x6E07CBF: gst_base_src_get_range (gstbasesrc.c:2499)
  ==1308==    by 0x6E09DEA: gst_base_src_loop (gstbasesrc.c:2799)
  ==1308==    by 0x558E550: gst_task_func (gsttask.c:332)
  ==1308==    by 0x5AC8EED: g_thread_pool_thread_proxy (gthreadpool.c:307)
  ==1308==    by 0x5AC84F4: g_thread_proxy (gthread.c:784)
  ==1308==    by 0x5D71493: start_thread (pthread_create.c:333)
  ==1308==    by 0x690BA8E: clone (clone.S:97)


  Note: see also the FAQ in the source distribution.
  It contains workarounds to several common problems.
  In particular, if Valgrind aborted or crashed after
  identifying problems in your program, there's a good chance
  that fixing those problems will prevent Valgrind aborting or
  crashing, especially if it happened in m_mallocfree.c.

  If that doesn't help, please report this bug to: www.valgrind.org

  In the bug report, send all the above text, the valgrind
  version, and what OS and version you are using.  Thanks.

