Skip to content

Commit

Permalink
Some odd case do not compress well, overallocate to cope with them
Browse files Browse the repository at this point in the history
  • Loading branch information
malaterre committed Mar 21, 2018
1 parent db21f4f commit cbd87be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ bool JPEGLSCodec::Code(DataElement const &in, DataElement &out)
const char *inputdata = input + dim * image_len;

std::vector<BYTE> rgbyteCompressed;
rgbyteCompressed.resize(image_width * image_height * 4);
rgbyteCompressed.resize(image_width * image_height * 4 * 2); // overallocate in case of weird case

size_t cbyteCompressed;
const bool b = this->CodeFrameIntoBuffer((char*)&rgbyteCompressed[0], rgbyteCompressed.size(), cbyteCompressed, inputdata, inputlength );
Expand Down

0 comments on commit cbd87be

Please sign in to comment.