Skip to content

Commit

Permalink
Merge pull request #13337 from Snuffleupagus/PredictorStream-super
Browse files Browse the repository at this point in the history
[Regression] Move the `super`-call in the `PredictorStream`-constructor to prevent errors (PR 13303)
  • Loading branch information
calixteman committed May 5, 2021
2 parents a00913a + 99fae47 commit 5296119
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/predictor_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ import { isDict } from "./primitives.js";

class PredictorStream extends DecodeStream {
constructor(str, maybeLength, params) {
super(maybeLength);

if (!isDict(params)) {
return str; // no prediction
}
const predictor = params.get("Predictor") || 1;
const predictor = (this.predictor = params.get("Predictor") || 1);

if (predictor <= 1) {
return str; // no prediction
}
if (predictor !== 2 && (predictor < 10 || predictor > 15)) {
throw new FormatError(`Unsupported predictor: ${predictor}`);
}
super(maybeLength);
this.predictor = predictor;

if (predictor === 2) {
this.readBlock = this.readBlockTiff;
Expand Down

0 comments on commit 5296119

Please sign in to comment.