| 152 | |
| 153 | |
| 154 | const void* getBlockCheckedRaw(const QByteArray& byte_array, quint32 pos, quint32 block_size) |
| 155 | { |
| 156 | if (pos == 0) |
| 157 | { |
| 158 | return nullptr; |
| 159 | } |
| 160 | else if (Q_UNLIKELY(quint64(pos) + block_size > std::numeric_limits<quint32>::max() |
| 161 | || pos + block_size - 1 >= quint32(byte_array.size()))) |
| 162 | { |
| 163 | qWarning("Ocd::getBlockChecked: Requested data block is out of bounds"); |
| 164 | return nullptr; |
| 165 | } |
| 166 | return byte_array.data() + pos; |
| 167 | } |
| 168 | |
| 169 | |
| 170 | QByteArray& addPadding(QByteArray& byte_array) |
no test coverage detected