Current master fails with image #2565
This commit is contained in:
parent
498f4ce273
commit
c4e514cff8
@ -152,7 +152,7 @@ void JpegBase::readMetadata() {
|
|||||||
const auto [sizebuf, size] = readSegmentSize(marker, *io_);
|
const auto [sizebuf, size] = readSegmentSize(marker, *io_);
|
||||||
|
|
||||||
// Read the rest of the segment.
|
// Read the rest of the segment.
|
||||||
DataBuf buf(size);
|
DataBuf buf(size + 1);
|
||||||
/// \todo check if it makes sense to check for size
|
/// \todo check if it makes sense to check for size
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
|
io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
|
||||||
@ -353,7 +353,7 @@ void JpegBase::printStructure(std::ostream& out, PrintStructureOption option, si
|
|||||||
const auto [sizebuf, size] = readSegmentSize(marker, *io_);
|
const auto [sizebuf, size] = readSegmentSize(marker, *io_);
|
||||||
|
|
||||||
// Read the rest of the segment.
|
// Read the rest of the segment.
|
||||||
DataBuf buf(size);
|
DataBuf buf(size + 1);
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
|
io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
|
||||||
std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
|
std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
|
||||||
@ -565,7 +565,7 @@ DataBuf JpegBase::readNextSegment(byte marker) {
|
|||||||
const auto [sizebuf, size] = readSegmentSize(marker, *io_);
|
const auto [sizebuf, size] = readSegmentSize(marker, *io_);
|
||||||
|
|
||||||
// Read the rest of the segment.
|
// Read the rest of the segment.
|
||||||
DataBuf buf(size);
|
DataBuf buf(size + 1);
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
|
io_->readOrThrow(buf.data(2), size - 2, ErrorCode::kerFailedToReadImageData);
|
||||||
std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
|
std::copy(sizebuf.begin(), sizebuf.end(), buf.begin());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user