已关闭
[Bug]: Dereference of null pointer #42
pineapplebaby创建于 7月16日关闭于 16 天前
openharmony_ci
7月16日 评论:
7月16日 评论:
感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 [@peng5233](https://gitcode.com/peng5233) [@zhanghongran](https://gitcode.com/zhanghongran) 。如果需要调整订阅PR、Issue的变更状态,请访问链接。
Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer gitcode for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.


7月16日 添加了label:waiting_for_assign
23 天前 关联了pull request:[Bug]: Dereference of null pointer
16 天前 关闭了 issue
16 天前 issue状态由 待办的 改变为 已完成
10 小时前 关联了pull request:[Bug]: Dereference of null pointer
感谢对OpenHarmony社区的支持与关注,欢迎反馈缺陷。
发生了什么问题?
framework/algorithm/common/image_openclsetup.cpp(约 129–160 行)
ChooseDevice 先把 idxDevices[platform] 设为 (cl_uint)-1,再在设备列表里挑选。若 numDevices 为 0,循环不进入,下标保持 -1。随后只要 deviceName 非空,就会在校验「是否选到设备」之前,用 devices[...][idxDevices[...]] 去调 clGetDeviceInfo:
期望行为是什么?
未选到设备时直接返回 CL_DEVICE_NOT_FOUND,不要调用 clGetDeviceInfo。只有下标有效时才查询 CL_DEVICE_NAME。
如何复现该缺陷
把「无 GPU」检查提前到 deviceName 查询之前:
其他补充信息
版本或分支信息