diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-12-11 00:05:19 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-12-11 00:05:19 +0000 |
commit | 7c73a8366daf5e0837cb5298fe7e21490a220485 (patch) | |
tree | 030efa138f69ff8e1f0296e43cda0b0b1898881d | |
parent | 032cdf8102a640c7ac0c437dfffaf4d2e65399da (diff) | |
parent | 080c4cc6fa41ec10eed0ff8253b02065b1d746dc (diff) | |
download | libjpeg-turbo-android11-qpr2-release.tar.gz |
Snap for 7025657 from 080c4cc6fa41ec10eed0ff8253b02065b1d746dc to rvc-qpr2-releaseandroid-11.0.0_r37android-11.0.0_r36android-11.0.0_r35android-11.0.0_r34android-11.0.0_r33android-11.0.0_r32android11-qpr2-release
Change-Id: I462f1d67e0711508cad0350aa27d00d843442d3e
-rw-r--r-- | README.android | 5 | ||||
-rw-r--r-- | jdapistd.c | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/README.android b/README.android index 12f476d1..b585b6b9 100644 --- a/README.android +++ b/README.android @@ -18,3 +18,8 @@ been moved into a dedicated rodata section. There's a pull request upstream for this as well. If that's accepted, this can be removed as an Android-specific modification. https://github.com/libjpeg-turbo/libjpeg-turbo/pull/318 + +(3) jdapistd.c + +Includes a cherry-pick of +https://github.com/libjpeg-turbo/libjpeg-turbo/commit/6d2e8837b440ce4d8befd805a5abc0d351028d70 @@ -316,6 +316,9 @@ LOCAL(void) read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines) { JDIMENSION n; + JSAMPLE dummy_sample[1] = { 0 }; + JSAMPROW dummy_row = dummy_sample; + JSAMPARRAY scanlines = NULL; void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows) = NULL; @@ -325,6 +328,10 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines) if (cinfo->cconvert && cinfo->cconvert->color_convert) { color_convert = cinfo->cconvert->color_convert; cinfo->cconvert->color_convert = noop_convert; + /* This just prevents UBSan from complaining about adding 0 to a NULL + * pointer. The pointer isn't actually used. + */ + scanlines = &dummy_row; } if (cinfo->cquantize && cinfo->cquantize->color_quantize) { @@ -333,7 +340,7 @@ read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines) } for (n = 0; n < num_lines; n++) - jpeg_read_scanlines(cinfo, NULL, 1); + jpeg_read_scanlines(cinfo, scanlines, 1); if (color_convert) cinfo->cconvert->color_convert = color_convert; |