View Issue Details

IDProjectCategoryView StatusLast Update
0004799ardourbugspublic2020-04-19 20:16
Reporterahurst Assigned Tocth103  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status closedResolutionno change required 
Product Version3.0-beta3 
Target Version3.0 
Summary0004799: Null pointer dereference probably causing crash
DescriptionHigh impact static analysis bug:

A null pointer is dereferenced in libs/ardour/audio_buffer.cc:38.

This occurs in the constructor of AudioBuffer when the capacity is > 0.
Additional Information30AudioBuffer::AudioBuffer(size_t capacity)
31 : Buffer(DataType::AUDIO, capacity)
32 , _owns_data (false)
33 , _data (0)
Assigning: "this->_data" = "NULL".
34{
35 if (_capacity > 0) {
36 _owns_data = true; // prevent resize() from gagging
37 resize (_capacity);
38 _silent = false; // force silence on the intial buffer state
*** Passing "this" to function "ARDOUR::AudioBuffer::silence", which dereferences null "this->_data".
39 silence (_capacity);

In /libs/ardour/ardour/audio_buffer.h:
34 void silence (framecnt_t len, framecnt_t offset = 0) {
35 if (!_silent) {
36 assert(_capacity > 0);
37 assert(offset + len <= _capacity);
*** Function "memset(void *, int, size_t)" dereferences an offset off "this->_data".
38 memset(_data + offset, 0, sizeof (Sample) * len);
39 if (len == _capacity) {
40 _silent = true;
41 }
42 }
43 _written = true;
44 }
40 }
41}
TagsNo tags attached.

Activities

cth103

2012-04-01 14:44

administrator   ~0013054

_data is set up by resize(), unless I misunderstand your point...

system

2020-04-19 20:16

developer   ~0023011

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2012-03-28 00:01 ahurst New Issue
2012-03-28 12:24 cth103 cost => 0.00
2012-03-28 12:24 cth103 Fixed in Version => 3.0 beta4
2012-03-28 14:23 cth103 Fixed in Version 3.0 beta4 =>
2012-03-28 14:23 cth103 Target Version => 3.0 beta4
2012-04-01 14:44 cth103 Note Added: 0013054
2012-04-01 14:44 cth103 Status new => resolved
2012-04-01 14:44 cth103 Resolution open => no change required
2012-04-01 14:44 cth103 Assigned To => cth103
2012-05-23 15:08 cth103 Target Version 3.0 beta4 => 3.0
2020-04-19 20:16 system Note Added: 0023011
2020-04-19 20:16 system Status resolved => closed