Fix null pointer dereference (as hinted by Coverity)

Plus some `const` fixes.
This commit is contained in:
Flössie
2018-01-01 12:13:29 +01:00
parent 3d40d9cdce
commit 0b7b1d6ab3
3 changed files with 19 additions and 15 deletions

View File

@@ -1572,7 +1572,7 @@ double Tag::toDouble (int ofs) const
/**
* @brief Create an array of the elements
*/
double *Tag::toDoubleArray (int ofs)
double* Tag::toDoubleArray (int ofs) const
{
double *values = new double[count];
@@ -1583,7 +1583,7 @@ double *Tag::toDoubleArray (int ofs)
return values;
}
void Tag::toRational (int& num, int& denom, int ofs)
void Tag::toRational (int& num, int& denom, int ofs) const
{
switch (type) {
@@ -1632,7 +1632,7 @@ void Tag::toRational (int& num, int& denom, int ofs)
}
}
void Tag::toString (char* buffer, int ofs)
void Tag::toString (char* buffer, int ofs) const
{
if (type == UNDEFINED && !directory) {