Repository: mozilla/pdf.js
File: src/core/evaluator.js (JavaScript)

Code before:
        groupOptions.isolated = group.get("I") || false;
        groupOptions.knockout = group.get("K") || false;
        if (group.has("CS")) {
          const cs = this._getColorSpace(
            group.getRaw("CS"),
            resources,
            localColorSpaceCache
          );
          colorSpace =
            cs instanceof ColorSpace ? cs : await this._handleColorSpace(cs);
        }
      }

      if (smask?.backdrop) {
        colorSpace ||= ColorSpaceUtils.rgb;
        smask.backdrop = colorSpace.getRgb(smask.backdrop, 0);
      }

      operatorList.addOp(OPS.beginGroup, [groupOptions]);
    }

    // If it's a group, a new canvas will be created that is the size of the
    // bounding box and translated to the correct position so we don't need to
    // apply the bounding box to it.
    const f32Matrix = new Float32Array(matrix);
    const args = [f32Matrix, group ? null : new Float32Array(bbox)];
    operatorList.addOp(OPS.paintFormXObjectBegin, args);

    await this.getOperatorList({
      stream: xobj,
      task,
      resources: dict.get("Resources") || resources,
      operatorList,
      initialState,
    });
    operatorList.addOp(OPS.paintFormXObjectEnd, []);

    if (group) {
      operatorList.addOp(OPS.endGroup, [groupOptions]);
    }

    if (optionalContent !== undefined) {
      operatorList.addOp(OPS.endMarkedContent, []);
    }
  }

  _sendImgData(objId, imgData, cacheGlobally = false) {
    if (
      (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) &&
      imgData
    ) {

Review comment (suggestion):
Note that both the matrix *and* the bbox can be `null`.
```suggestion
    const f32Matrix = matrix && new Float32Array(matrix),
      f32Bbox = bbox && new Float32Array(bbox);
    const args = [f32Matrix, group ? null : f32Bbox];
```

Code after:
        groupOptions.isolated = group.get("I") || false;
        groupOptions.knockout = group.get("K") || false;
        if (group.has("CS")) {
          const cs = this._getColorSpace(
            group.getRaw("CS"),
            resources,
            localColorSpaceCache
          );
          colorSpace =
            cs instanceof ColorSpace ? cs : await this._handleColorSpace(cs);
        }
      }

      if (smask?.backdrop) {
        colorSpace ||= ColorSpaceUtils.rgb;
        smask.backdrop = colorSpace.getRgb(smask.backdrop, 0);
      }

      operatorList.addOp(OPS.beginGroup, [groupOptions]);
    }

    // If it's a group, a new canvas will be created that is the size of the
    // bounding box and translated to the correct position so we don't need to
    // apply the bounding box to it.
    const f32matrix = matrix && new Float32Array(matrix);
    const f32bbox = (!group && bbox && new Float32Array(bbox)) || null;
    const args = [f32matrix, f32bbox];
    operatorList.addOp(OPS.paintFormXObjectBegin, args);

    await this.getOperatorList({
      stream: xobj,
      task,
      resources: dict.get("Resources") || resources,
      operatorList,
      initialState,
    });
    operatorList.addOp(OPS.paintFormXObjectEnd, []);

    if (group) {
      operatorList.addOp(OPS.endGroup, [groupOptions]);
    }

    if (optionalContent !== undefined) {
      operatorList.addOp(OPS.endMarkedContent, []);
    }
  }

  _sendImgData(objId, imgData, cacheGlobally = false) {
    if (
      (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) &&
      imgData