Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-718

Unterminated iteration in JPEGReader class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Resolution: Unresolved
    • 0.20.5
    • None
    • image/unqualified
    • None
    • Operating System: other
      Platform: Other
    • 22450

    Description

      Look at the JPEGReader class in the org.apache.fop.image.analyzer package. In
      the setDimension(...) method, can have an unterminated iteration. Why?

      The method reads bytes from input stream, with a:

      while ((marker = imageStream.read()) != MARK) {
      ...
      }

      Look at the description of the BufferedInputStream.read() method.: "If no byte
      is available because the end of the stream has been reached, the value -1 is
      returned.".

      In the above iteration the author missed check this condition, so the method can
      iterate over and over.

      Sollution:
      Check the end condition.

      best regards: Zsolt Kulcsar

      Attachments

        Activity

          People

            Unassigned Unassigned
            zkulcsar@ish.hu Zsolt Kulcsar
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: