Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions graf2d/asimage/src/libAfterImage/libjpeg/jdpostct.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ post_process_1pass (j_decompress_ptr cinfo,
my_post_ptr post = (my_post_ptr) cinfo->post;
JDIMENSION num_rows, max_rows;

/* read_and_discard_scanlines may call it with rows "available", but no buffer */
if (output_buf == NULL) {
return;
}

/* Fill the buffer, but not more than what we can dump out in one go. */
/* Note we rely on the upsampler to detect bottom of image. */
max_rows = out_rows_avail - *out_row_ctr;
Expand Down
4 changes: 4 additions & 0 deletions graf2d/asimage/src/libAfterImage/libjpeg/jquant1.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,10 @@ quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
JDIMENSION col;
JDIMENSION width = cinfo->output_width;

if (output_buf == NULL && num_rows) {
ERREXIT(cinfo, JERR_BAD_PARAM);
}

for (row = 0; row < num_rows; row++) {
/* Initialize output values to 0 so can process components separately */
jzero_far((void FAR *) output_buf[row],
Expand Down
Loading