Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Fix 4287289, where undefined behavior triggered in jpeg tile based
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Wei-Ta Chen committed Apr 30, 2011
1 parent 07e6988 commit d4fad7f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jdmarker.c
Expand Up @@ -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.
Expand Down

0 comments on commit d4fad7f

Please sign in to comment.