Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8263983

Potential bug in awt_ImagingLib.c setImageHints

XMLWordPrintable

    • 2d

      SonarCloud reports this problem:
        This branch can not be reached because the condition duplicates a previous condition in the same sequence of "if/else if" statements

      Here:

      static int
      setImageHints(JNIEnv *env, BufImageS_t *srcP, BufImageS_t *dstP,
                    int expandICM, int useAlpha,
                    int premultiply, mlibHintS_t *hintP)
      {
      ...
                       if (dstCMP->isDefaultCompatCM) {
                          hintP->allocDefaultDst = FALSE;
                          hintP->cvtToDst = FALSE;
                      }
                      else if (dstCMP->isDefaultCompatCM) { // <---- here
                          hintP->allocDefaultDst = FALSE;
                          hintP->cvtToDst = FALSE;
                      }

      I wonder if srcCMP->isDefaultCompatCM was meant instead.

            jdv Jayathirth D V
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: