Skip to content

Commit

Permalink
Enlarged the lazy allocation of the subsampling array.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Richter committed Jan 15, 2024
1 parent 9e0cea2 commit 667a7e1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/reconstruct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
** command line interface. It doesn't do much except
** calling libjpeg.
**
** $Id: reconstruct.cpp,v 1.10 2022/08/05 11:25:24 thor Exp $
** $Id: reconstruct.cpp,v 1.11 2024/01/15 06:38:22 thor Exp $
**
*/

Expand Down Expand Up @@ -119,7 +119,10 @@ void Reconstruct(const char *infile,const char *outfile,
tags->SetTagData(JPGTAG_DECODER_STOP,0);
#endif
if (ok && jpeg->Read(tags)) {
UBYTE subx[4],suby[4];
// Note that this is really lazy. In reality, the code
// should first obtain the number of components and then
// allocate the subsampling array.
UBYTE subx[256],suby[256];
struct JPG_TagItem atags[] = {
JPG_ValueTag(JPGTAG_IMAGE_PRECISION,0),
JPG_ValueTag(JPGTAG_IMAGE_IS_FLOAT,false),
Expand Down

0 comments on commit 667a7e1

Please sign in to comment.