diff options
author | Wei-Ta Chen <weita@google.com> | 2011-04-29 18:11:33 -0700 |
---|---|---|
committer | Wei-Ta Chen <weita@google.com> | 2011-04-29 18:11:33 -0700 |
commit | d4fad7f50f79626455d88523207e05b868819cd8 (patch) | |
tree | 1ab5a2be9bd1df3447a4a167a3b52c4830645242 | |
parent | 07e6988e9c9ed5bf5cb457d4f0ba7ca08c4e0b22 (diff) | |
download | jpeg-tools_r20.tar.gz |
Fix 4287289, where undefined behavior triggered in jpeg tile basedandroid-sdk-adt_r20android-sdk-adt_r16.0.1android-sdk-4.0.3_r1android-sdk-4.0.3-tools_r1android-cts-verifier-4.0_r1android-cts-verifier-4.0.3_r1android-cts-4.1_r2android-cts-4.1_r1android-cts-4.0_r1android-cts-4.0.3_r2android-cts-4.0.3_r1android-4.1.2_r2.1android-4.1.2_r2android-4.1.2_r1android-4.1.1_r6.1android-4.1.1_r6android-4.1.1_r5android-4.1.1_r4android-4.1.1_r3android-4.1.1_r2android-4.1.1_r1.1android-4.1.1_r1android-4.0.4_r2.1android-4.0.4_r2android-4.0.4_r1.2android-4.0.4_r1.1android-4.0.4_r1android-4.0.3_r1.1android-4.0.3_r1android-4.0.2_r1android-4.0.1_r1.2android-4.0.1_r1.1android-4.0.1_r1tools_r20jb-releasejb-mr0-releaseics-plus-aospics-mr1-releaseics-mr1ics-mr0-releaseics-mr0ics-factoryrom-2-release
decoding.
The issue is that we set a flag to the current SOS marker position, but
we don't initialize the flag before testing the flag.
Change-Id: I4e0cc243a36c348584e888d95fcba2af896f6bc2
-rw-r--r-- | jdmarker.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1310,6 +1310,11 @@ jinit_marker_reader (j_decompress_ptr cinfo) marker->pub.read_markers = read_markers; marker->pub.read_restart_marker = read_restart_marker; marker->pub.get_sos_marker_position = get_sos_marker_position; + + // Initialize the SOS marker position to avoid underdefined behavior due to + // using a undefined field. + marker->pub.current_sos_marker_position = 0; + /* Initialize COM/APPn processing. * By default, we examine and then discard APP0 and APP14, * but simply discard COM and all other APPn. |