{"record":{"id":"f51c94cf32d6b74d","repo":"mozilla/pdf.js","slug":"unsupported-predictor-predictor","errorCode":null,"errorMessage":"Unsupported predictor: ${predictor}","messagePattern":"Unsupported predictor: (.+?)","errorType":"exception","errorClass":"FormatError","httpStatus":null,"severity":"error","filePath":"src/core/predictor_stream.js","lineNumber":33,"sourceCode":"\nimport { DecodeStream } from \"./decode_stream.js\";\nimport { Dict } from \"./primitives.js\";\nimport { FormatError } from \"../shared/util.js\";\n\nclass PredictorStream extends DecodeStream {\n  constructor(str, maybeLength, params) {\n    super(maybeLength);\n\n    if (!(params instanceof Dict)) {\n      return str; // no prediction\n    }\n    const predictor = (this.predictor = params.get(\"Predictor\") || 1);\n\n    if (predictor <= 1) {\n      return str; // no prediction\n    }\n    if (predictor !== 2 && (predictor < 10 || predictor > 15)) {\n      throw new FormatError(`Unsupported predictor: ${predictor}`);\n    }\n\n    this.readBlock = predictor === 2 ? this.readBlockTiff : this.readBlockPng;\n\n    this.stream = str;\n    this.dict = str.dict;\n\n    const colors = (this.colors = params.get(\"Colors\") || 1);\n    const bits = (this.bits = params.get(\"BPC\", \"BitsPerComponent\") || 8);\n    const columns = (this.columns = params.get(\"Columns\") || 1);\n\n    this.pixBytes = (colors * bits + 7) >> 3;\n    this.rowBytes = (columns * colors * bits + 7) >> 3;\n\n    return this;\n  }\n\n  readBlockTiff() {","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/core/predictor_stream.js#L15-L51","documentation":"Error \"Unsupported predictor: ${predictor}\" thrown in mozilla/pdf.js.","triggerScenarios":"Thrown at src/core/predictor_stream.js:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the stream's /Predictor value to a supported predictor (1, 2, or 10-15); other predictor values are not supported.","If the predictor is valid but the PDF is non-conforming, regenerate the stream with a standard PNG/TIFF predictor value."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}