VAAPI: do not crash when vlc_va_Initialize fails.
Upon failure of vlc_va_Initialize() the error path jumped to the label 'error', which would call sys->conn->unlock(). However the error path was taken before sys->conn->lock() was called and even worse sys->conn = NULL in this case. This would result into crash obviously. Therefor move the 'error' label one line down, so it only calls the cleanup routions and add a lable 'unlock' for the error paths that need to unlock first before cleaning up.
Showing
Please register or sign in to comment