-
Notifications
You must be signed in to change notification settings - Fork 17
fix bug (AEGHB-1270) #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks. Will fix this. |
|
Hi @Kevincoooool ,我运行xiaozhi-esp32,复现了。不过组件本身的examples编译没问题,会不会是c++编译要求高导致的? |
|
但是没有在官方的示例中复现到这个问题,似乎和传入 esp_video_init 的传参有关系。你能打包一个最小的复现程序吗(删除 build 目录,保留 sdkconfig 文件)? |
我也是用xiaozhi-esp32,把video组件版本改为1.3.0,然后芯片选用ESP32S3,启用DVP摄像头再编译就会复现,因为S3不支持MIPI |
|
不支持 MIPI 的情况下, 根据依赖关系,它是自动关掉 MIPI 相关的代码的。 |
使用的xiaozhi-esp32最新代码,组件太多打包比较大,把sdkconfig放上来了 |
IDF5.5.1 |
|
@Kevincoooool 请更新 esp-video 的 yml 文件中的 版本号到 1.3.1。并更新 esp-video 的 changlog: 1.3.1
|
好的 |
请合并提交到一个 commit message: |
commit msg 太简单啦,可以通过 git commit --amend 命令修改为 fix: fix array bounds check failure in destroy_sccb_device |
1.Fix array bounds check failure in destroy_sccb_device() when compile option is OPTIMIZATION_SIZE. 2.Update the component version and update the CHANGELOG.
好嘞,感谢感谢 |

esp_video组件存在数组越界Bug:// 错误的代码(第296-297行)
s_sensor_sccb_mask[i2c_port].sccb_io[0] = NULL;
s_sensor_sccb_mask[i2c_port].sccb_io[1] = NULL; // ❌ 数组越界! 问题分析:
sccb_io 数组大小定义为 ESP_VIDEO_INIT_DEV_NUMS
这是一个枚举值,取决于启用的视频设备数量
您只启用了DVP设备,所以 ESP_VIDEO_INIT_DEV_NUMS = 1
数组只有 sccb_io[0],但代码试图访问 sccb_io[1]
GCC的 -Werror=array-bounds 检测到越界访问并报错
🔧 修复内容
// 修复后的代码(第296-298行)
s_sensor_sccb_mask[i2c_port].handle = NULL;
for (int j = 0; j < ESP_VIDEO_INIT_DEV_NUMS; j++) {
s_sensor_sccb_mask[i2c_port].sccb_io[j] = NULL;
}
将硬编码的数组访问改为循环:
这样无论 ESP_VIDEO_INIT_DEV_NUMS 的值是多少(1、2、3...),代码都能正确工作。