aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei-Ta Chen <weita@google.com>2011-04-29 18:11:33 -0700
committerWei-Ta Chen <weita@google.com>2011-04-29 18:11:33 -0700
commitd4fad7f50f79626455d88523207e05b868819cd8 (patch)
tree1ab5a2be9bd1df3447a4a167a3b52c4830645242
parent07e6988e9c9ed5bf5cb457d4f0ba7ca08c4e0b22 (diff)
downloadjpeg-tools_r20.tar.gz
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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/jdmarker.c b/jdmarker.c
index 7332940..5837edb 100644
--- a/jdmarker.c
+++ b/jdmarker.c
@@ -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.