vulkan: Fix out-of-bound read
authorEdward Hervey <edward@centricular.com>
Tue, 21 Nov 2017 15:39:14 +0000 (16:39 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Tue, 21 Nov 2017 15:39:14 +0000 (16:39 +0100)
G_N_ELEMENTS is the *number* of entries, not the maximum entry number

CID #1417215

ext/vulkan/vkupload.c

index f42010f..07bf6e5 100644 (file)
@@ -777,7 +777,7 @@ _upload_find_method (GstVulkanUpload * vk_upload)
 {
   vk_upload->current_impl++;
 
-  if (vk_upload->current_impl > G_N_ELEMENTS (upload_methods))
+  if (vk_upload->current_impl >= G_N_ELEMENTS (upload_methods))
     return FALSE;
 
   GST_DEBUG_OBJECT (vk_upload, "attempting upload with uploader %s",