Back to what we saw in the valgrind output. Based on the function names that we saw, we were guessing that it is handling the resize somehow. We can be totally off but it does appear to us that this is the case.
==1199== Conditional jump or move depends on uninitialised value(s)
==1199== at 0x5F8A2F0: veglFreeRenderList (gc_egl_surface.c:2861)
==1199== by 0x5F8A81B: veglResizeSurface (gc_egl_surface.c:1412)
==1199== by 0x5F8635B: veglMakeCurrent (gc_egl_context.c:2508)
==1199== by 0x5F86D53: eglMakeCurrent (gc_egl_context.c:2633)
==1199== Conditional jump or move depends on uninitialised value(s)
==1199== at 0x5F3839C: gcoVGHARDWARE_ScheduleVideoMemory (gc_hal_user_hardware_vg.c:8030)
==1199== by 0x5E97087: _FreeSurface (gc_hal_user_surface.c:910)
==1199== by 0x5E9767F: gcoSURF_Destroy (gc_hal_user_surface.c:2135)
==1199== by 0x5F8A337: veglFreeRenderList (gc_egl_surface.c:2875)
==1199== by 0x5F8A81B: veglResizeSurface (gc_egl_surface.c:1412)
==1199== by 0x5F8635B: veglMakeCurrent (gc_egl_context.c:2508)
==1199== by 0x5F86D53: eglMakeCurrent (gc_egl_context.c:2633)
==1199==
==1199== Invalid read of size 4
==1199== at 0x5F89260: veglAddRenderListSurface (gc_egl_surface.c:2789)
==1199== by 0x5F89D33: _CreateSurfaceObjects (gc_egl_surface.c:600)
==1199== by 0x5F8A853: veglResizeSurface (gc_egl_surface.c:1440)
==1199== by 0x5F8635B: veglMakeCurrent (gc_egl_context.c:2508)
==1199== by 0x5F86D53: eglMakeCurrent (gc_egl_context.c:2633)
==1199==
==1199== Invalid read of size 4
==1199== at 0x5F89D40: _CreateSurfaceObjects (gc_egl_surface.c:603)
==1199== by 0x5F8A853: veglResizeSurface (gc_egl_surface.c:1440)
==1199== by 0x5F8635B: veglMakeCurrent (gc_egl_context.c:2508)
==1199== by 0x5F86D53: eglMakeCurrent (gc_egl_context.c:2633)
==1199== by 0x64C37CB: QVgQpaContext::makeCurrent(void*) (qvgqpacontext.cpp:91)
==1199== by 0x64C0B5F: QVgQpaBackingStore::beginPaint(QRegion const&) (qvgqpabackingstore.cpp:2359)
==1199== by 0x496D0DB: ??? (in /usr/lib/libQt5Widgets.so.5.5.1)
==1199== Address 0x62ad9d0 is 8 bytes inside a block of size 24 free'd
==1199== at 0x4845FFC: free (in /usr/lib/valgrind/vgpreload_memcheck-arm-linux.so)
==1199==
==1199== Invalid read of size 4
==1199== at 0x5E9DFDC: gcoSURF_ReferenceSurface (gc_hal_user_surface.c:12505)
==1199== by 0x5F89D4B: _CreateSurfaceObjects (gc_egl_surface.c:604)
==1199== by 0x5F8A853: veglResizeSurface (gc_egl_surface.c:1440)
==1199== by 0x5F8635B: veglMakeCurrent (gc_egl_context.c:2508)
==1199== by 0x5F86D53: eglMakeCurrent (gc_egl_context.c:2633)
==1199== by 0x64C37CB: QVgQpaContext::makeCurrent(void*) (qvgqpacontext.cpp:91)
==1199== by 0x64C0B5F: QVgQpaBackingStore::beginPaint(QRegion const&) (qvgqpabackingstore.cpp:2359)
==1199== by 0x496D0DB: ??? (in /usr/lib/libQt5Widgets.so.5.5.1)
==1199== Address 0x394 is not stack'd, malloc'd or (recently) free'd
==1199==
==1199== Process terminating with default action of signal 11 (SIGSEGV)
==1199== Access not within mapped region at address 0x394
==1199== at 0x5E9DFDC: gcoSURF_ReferenceSurface (gc_hal_user_surface.c:12505)
==1199== by 0x5F89D4B: _CreateSurfaceObjects (gc_egl_surface.c:604)
==1199== by 0x5F8A853: veglResizeSurface (gc_egl_surface.c:1440)
==1199== by 0x5F8635B: veglMakeCurrent (gc_egl_context.c:2508)
==1199== by 0x5F86D53: eglMakeCurrent (gc_egl_context.c:2633)