瀏覽代碼

Fix potential unitialized variable

Martijn Braam 1 年之前
父節點
當前提交
92044e7233
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/pipeline.c

+ 1 - 1
src/pipeline.c

@@ -101,7 +101,7 @@ load_entity_ids(libmegapixels_camera *camera)
 
 	for (int i = 0; i < topology.num_links; i++) {
 		if (links[i].flags & MEDIA_LNK_FL_ENABLED && !(links[i].flags & MEDIA_LNK_FL_IMMUTABLE)) {
-			uint32_t source_entity, sink_entity;
+			uint32_t source_entity = 0, sink_entity = 0;
 			for (int j = 0; j < topology.num_pads; j++) {
 				if (pads[j].id == links[i].source_id) {
 					source_entity = pads[j].entity_id;