]> granicus.if.org Git - handbrake/commitdiff
nvenc: fix crash in nvenc_load_functions
authorJohn Stebbins <jstebbins.hb@gmail.com>
Fri, 29 Jun 2018 21:29:18 +0000 (14:29 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Fri, 29 Jun 2018 21:29:18 +0000 (14:29 -0700)
nvenc_load_functions tries to free the input NvencFunctions before
loading.  Set pointer to NULL to prevent free of invalid pointer.

libhb/nvenc_common.c

index 6d1fcead6cf8003bdadd552bb95a2abd0c662d4d..15e5c9ab5d9858def7f539bd4710cf36603d1861 100644 (file)
@@ -37,7 +37,7 @@ int hb_check_nvenc_available()
     #ifdef USE_NVENC
         uint32_t nvenc_ver;
         void *context;
-        NvencFunctions *nvenc_dl;
+        NvencFunctions *nvenc_dl = NULL;
 
         int loadErr = nvenc_load_functions(&nvenc_dl, context);
         if (loadErr < 0) {