==1390== Memcheck, a memory error detector
==1390== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==1390== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==1390== Command: ./vaapi_test 10
==1390== 
0:00:13.270541824  1390     0x187f8e00 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x19677ff0
0:00:13.485720036  1390     0x196755d0 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x9ba1c10
0:00:17.736417905  1390      0x9b9bfd0 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0xa14f4f0
0:00:22.039354738  1390      0x9d201d0 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0xa0bb550
0:00:25.131336228  1390     0x17a1cb00 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x9cb8810
0:00:26.522567282  1390     0x185d0dc0 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0xa037230
0:00:27.701183237  1390      0x9ded250 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0xa1315b0
0:00:30.005420767  1390      0x9cbcd40 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0xa1db8e0
==1390== Thread 21 videotestsrc6:sr:
==1390== Invalid write of size 4
==1390==    at 0xE8113FB: handleVAEncPictureParameterBufferType (picture.c:430)
==1390==    by 0xE8113FB: vlVaRenderPicture (picture.c:541)
==1390==    by 0xA5D388A: do_encode (gstvaapiencoder_objects.c:491)
==1390==    by 0xA5D3F74: gst_vaapi_enc_picture_encode (gstvaapiencoder_objects.c:560)
==1390==    by 0xA5CDF07: gst_vaapi_encoder_h264_encode (gstvaapiencoder_h264.c:2581)
==1390==    by 0xA5C49C8: gst_vaapi_encoder_put_frame (gstvaapiencoder.c:407)
==1390==    by 0xA595EC9: gst_vaapiencode_handle_frame (gstvaapiencode.c:643)
==1390==    by 0x8294C1E: gst_video_encoder_chain (gstvideoencoder.c:1438)
==1390==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1390==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1390==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1390==    by 0x6E111F9: gst_base_transform_chain (gstbasetransform.c:2312)
==1390==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1390==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1390==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1390==  Address 0x187bae2c is 20 bytes after a block of size 664 alloc'd
==1390==    at 0x4C2DBC5: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1390==    by 0xE80F31D: vlVaCreateContext (context.c:223)
==1390==    by 0xAE6F841: vaCreateContext (in /usr/lib/x86_64-linux-gnu/libva.so.1.4000.0)
==1390==    by 0xA599E36: context_create (gstvaapicontext.c:210)
==1390==    by 0xA59A04E: gst_vaapi_context_new (gstvaapicontext.c:438)
==1390==    by 0xA5C52EB: gst_vaapi_encoder_ensure_context (gstvaapiencoder.c:790)
==1390==    by 0xA5C52EB: gst_vaapi_encoder_reconfigure_internal (gstvaapiencoder.c:840)
==1390==    by 0xA5C52EB: gst_vaapi_encoder_set_codec_state (gstvaapiencoder.c:914)
==1390==    by 0xA59622E: set_codec_state (gstvaapiencode.c:549)
==1390==    by 0xA5963A0: gst_vaapiencode_set_format (gstvaapiencode.c:563)
==1390==    by 0x8293E15: gst_video_encoder_setcaps (gstvideoencoder.c:594)
==1390==    by 0x8293E15: gst_video_encoder_sink_event_default (gstvideoencoder.c:946)
==1390==    by 0xA595287: gst_vaapiencode_sink_event (gstvaapiencode.c:781)
==1390==    by 0x5559C36: gst_pad_send_event_unchecked (gstpad.c:5608)
==1390==    by 0x555A0CD: gst_pad_push_event_unchecked (gstpad.c:5264)
==1390== 
0:00:32.840465576  1390      0xa21ead0 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0x19326e00
0:00:34.016111916  1390     0x195468a0 ERROR       vaapivideomemory gstvaapivideomemory.c:736:gst_video_info_update_from_surface: Cannot create a VA derived image from surface 0xa02bbc0
==1390== Thread 18 videotestsrc4:sr:
==1390== Invalid read of size 4
==1390==    at 0xE811352: handleVAEncSliceParameterBufferType (picture.c:458)
==1390==    by 0xE811352: vlVaRenderPicture (picture.c:545)
==1390==    by 0xA5D388A: do_encode (gstvaapiencoder_objects.c:491)
==1390==    by 0xA5D400E: gst_vaapi_enc_picture_encode (gstvaapiencoder_objects.c:577)
==1390==    by 0xA5CDF07: gst_vaapi_encoder_h264_encode (gstvaapiencoder_h264.c:2581)
==1390==    by 0xA5C49C8: gst_vaapi_encoder_put_frame (gstvaapiencoder.c:407)
==1390==    by 0xA595EC9: gst_vaapiencode_handle_frame (gstvaapiencode.c:643)
==1390==    by 0x8294C1E: gst_video_encoder_chain (gstvideoencoder.c:1438)
==1390==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1390==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1390==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1390==    by 0x6E111F9: gst_base_transform_chain (gstbasetransform.c:2312)
==1390==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1390==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1390==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1390==  Address 0x1929f93c is 4 bytes after a block of size 664 alloc'd
==1390==    at 0x4C2DBC5: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1390==    by 0xE80F31D: vlVaCreateContext (context.c:223)
==1390==    by 0xAE6F841: vaCreateContext (in /usr/lib/x86_64-linux-gnu/libva.so.1.4000.0)
==1390==    by 0xA599E36: context_create (gstvaapicontext.c:210)
==1390==    by 0xA59A04E: gst_vaapi_context_new (gstvaapicontext.c:438)
==1390==    by 0xA5C52EB: gst_vaapi_encoder_ensure_context (gstvaapiencoder.c:790)
==1390==    by 0xA5C52EB: gst_vaapi_encoder_reconfigure_internal (gstvaapiencoder.c:840)
==1390==    by 0xA5C52EB: gst_vaapi_encoder_set_codec_state (gstvaapiencoder.c:914)
==1390==    by 0xA59622E: set_codec_state (gstvaapiencode.c:549)
==1390==    by 0xA5963A0: gst_vaapiencode_set_format (gstvaapiencode.c:563)
==1390==    by 0x8293E15: gst_video_encoder_setcaps (gstvideoencoder.c:594)
==1390==    by 0x8293E15: gst_video_encoder_sink_event_default (gstvideoencoder.c:946)
==1390==    by 0xA595287: gst_vaapiencode_sink_event (gstvaapiencode.c:781)
==1390==    by 0x5559C36: gst_pad_send_event_unchecked (gstpad.c:5608)
==1390==    by 0x555A0CD: gst_pad_push_event_unchecked (gstpad.c:5264)
==1390== 
==1390== Thread 19 videotestsrc5:sr:
==1390== Invalid read of size 8
==1390==    at 0xE811E6D: vlVaEndPicture (picture.c:596)
==1390==    by 0xAE6FEAE: vaEndPicture (in /usr/lib/x86_64-linux-gnu/libva.so.1.4000.0)
==1390==    by 0xA5D4038: gst_vaapi_enc_picture_encode (gstvaapiencoder_objects.c:581)
==1390==    by 0xA5CDF07: gst_vaapi_encoder_h264_encode (gstvaapiencoder_h264.c:2581)
==1390==    by 0xA5C49C8: gst_vaapi_encoder_put_frame (gstvaapiencoder.c:407)
==1390==    by 0xA595EC9: gst_vaapiencode_handle_frame (gstvaapiencode.c:643)
==1390==    by 0x8294C1E: gst_video_encoder_chain (gstvideoencoder.c:1438)
==1390==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1390==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1390==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1390==    by 0x6E111F9: gst_base_transform_chain (gstbasetransform.c:2312)
==1390==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1390==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1390==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1390==  Address 0x1f is not stack'd, malloc'd or (recently) free'd
==1390== 
==1390== 
==1390== Process terminating with default action of signal 11 (SIGSEGV)
==1390==  Access not within mapped region at address 0x1F
==1390==    at 0xE811E6D: vlVaEndPicture (picture.c:596)
==1390==    by 0xAE6FEAE: vaEndPicture (in /usr/lib/x86_64-linux-gnu/libva.so.1.4000.0)
==1390==    by 0xA5D4038: gst_vaapi_enc_picture_encode (gstvaapiencoder_objects.c:581)
==1390==    by 0xA5CDF07: gst_vaapi_encoder_h264_encode (gstvaapiencoder_h264.c:2581)
==1390==    by 0xA5C49C8: gst_vaapi_encoder_put_frame (gstvaapiencoder.c:407)
==1390==    by 0xA595EC9: gst_vaapiencode_handle_frame (gstvaapiencode.c:643)
==1390==    by 0x8294C1E: gst_video_encoder_chain (gstvideoencoder.c:1438)
==1390==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1390==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1390==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1390==    by 0x6E111F9: gst_base_transform_chain (gstbasetransform.c:2312)
==1390==    by 0x555AF51: gst_pad_chain_data_unchecked (gstpad.c:4205)
==1390==    by 0x555AF51: gst_pad_push_data (gstpad.c:4457)
==1390==    by 0x55633E1: gst_pad_push (gstpad.c:4576)
==1390==  If you believe this happened as a result of a stack
==1390==  overflow in your program's main thread (unlikely but
==1390==  possible), you can try to increase the size of the
==1390==  main thread stack using the --main-stacksize= flag.
==1390==  The main thread stack size used in this run was 8388608.
==1390== 
==1390== HEAP SUMMARY:
==1390==     in use at exit: 144,252,461 bytes in 31,462 blocks
==1390==   total heap usage: 83,074 allocs, 51,612 frees, 209,838,465 bytes allocated
==1390== 
==1390== LEAK SUMMARY:
==1390==    definitely lost: 320 bytes in 10 blocks
==1390==    indirectly lost: 3,680 bytes in 160 blocks
==1390==      possibly lost: 39,748 bytes in 87 blocks
==1390==    still reachable: 142,399,501 bytes in 10,915 blocks
==1390==                       of which reachable via heuristic:
==1390==                         length64           : 632 bytes in 14 blocks
==1390==                         newarray           : 1,648 bytes in 23 blocks
==1390==         suppressed: 1,579,812 bytes in 19,517 blocks
==1390== Rerun with --leak-check=full to see details of leaked memory
==1390== 
==1390== For counts of detected and suppressed errors, rerun with: -v
==1390== ERROR SUMMARY: 50 errors from 3 contexts (suppressed: 0 from 0)
Segmentation fault

