Skip to content

Commit

Permalink
Add one more for JPEG
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud committed Jan 17, 2025
1 parent 363ca38 commit b61dce3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/shared/avifjpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,7 @@ static avifBool avifJPEGReadInternal(FILE * f,

int row_stride = cinfo.output_width * cinfo.output_components;
JSAMPARRAY buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr)&cinfo, JPOOL_IMAGE, row_stride, 1);
AVIF_ANNOTATE_MEMORY_IS_INITIALIZED(buffer, row_stride);

avif->width = cinfo.output_width;
avif->height = cinfo.output_height;
Expand Down Expand Up @@ -994,6 +995,7 @@ static avifBool avifJPEGReadInternal(FILE * f,
goto cleanup;
}
uint8_t * pixelRow = &rgb.pixels[row * rgb.rowBytes];
AVIF_ANNOTATE_MEMORY_IS_INITIALIZED(buffer, sizeof(buffer[0]));
AVIF_ANNOTATE_MEMORY_IS_INITIALIZED(buffer[0], rgb.rowBytes);
memcpy(pixelRow, buffer[0], rgb.rowBytes);
++row;
Expand Down

0 comments on commit b61dce3

Please sign in to comment.