Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-11892

ownDestructObjArray() return VX_SUCCESS even if objarr->base.obj_desc is NULL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Not Prioritized Not Prioritized
    • OpenVX Framework
    • TIOVX-1712
    • TIOVX_09.02.00
    • TIOVX_10.00.00
    • j784s4-evm

      When we max out the descriptors and call vxCreateObjectArray() or vxCreateVirtualObjectArray(),  vxReleaseObjectArray API never fails since ownDestructObjArray() returns VX_SUCCESS even if 
      objarr->base.obj_desc is NULL.
      In the below code, add an else condition to fix this issue.

       

      static vx_status ownDestructObjArray(vx_reference ref)
      {
         vx_status status= (vx_status)VX_SUCCESS;
         vx_object_arrayobjarr=NULL;
         if(ref->type== (vx_enum)VX_TYPE_OBJECT_ARRAY)
         {
           /* status set to NULL due to preceding type check */
           objarr=vxCastRefAsObjectArray(ref,NULL);
           if(objarr->base.obj_desc!=NULL)
           {
              tivx_obj_desc_object_array_t*obj_desc=
              (tivx_obj_desc_object_array_t *)objarr->base.obj_desc;
              status=ownReleaseRefFromObjArray(objarr, obj_desc->num_items);
              if ((vx_status)VX_SUCCESS==status)
              {
                 status=ownObjDescFree(&objarr->base.obj_desc);
                 if ((vx_status)VX_SUCCESS!=status)
                 { 
                    VX_PRINT(VX_ZONE_ERROR, "Object array object descriptor release failed!\n"); }
                 }
              }
           else
           {
              status= (vx_status)VX_ERROR_INVALID_REFERENCE;     //FIX
              VX_PRINT(VX_ZONE_ERROR, "Object descriptor is NULL!\n"); 
           }
      
         return status;
      }

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: