libcamera: media_device: Zero media graph arrays when querying topology
This silences valgrind that otherwise warns about usage of uninitialized values. While not strictly required as the kernel should fill the whole arrays in MEDIA_IOC_G_TOPOLOGY, the extra cost, in a non-critical path, is negligible compared to the ability to run without valgrind warnings. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
1b80471805
commit
c59272f417
1 changed files with 4 additions and 4 deletions
|
@ -240,10 +240,10 @@ int MediaDevice::populate()
|
||||||
delete[] pads;
|
delete[] pads;
|
||||||
delete[] interfaces;
|
delete[] interfaces;
|
||||||
|
|
||||||
ents = new media_v2_entity[topology.num_entities];
|
ents = new media_v2_entity[topology.num_entities]();
|
||||||
links = new media_v2_link[topology.num_links];
|
links = new media_v2_link[topology.num_links]();
|
||||||
pads = new media_v2_pad[topology.num_pads];
|
pads = new media_v2_pad[topology.num_pads]();
|
||||||
interfaces = new media_v2_interface[topology.num_interfaces];
|
interfaces = new media_v2_interface[topology.num_interfaces]();
|
||||||
|
|
||||||
version = topology.topology_version;
|
version = topology.topology_version;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue