code: def decode(self, buffer: bytes) -> tuple[int, int]:
      assert self.fd is not None
  
      img = io.BytesIO()
      blank_line = bytearray((0xFF,) * ((self.state.xsize + 7) // 8))
      try:
          self.fd.seek(32)
          rowmap = struct.unpack_from(
              f"<{self.state.ysize}H",
              self.fd.read(self.state.ysize * 2),
          )
      except struct.error as e:
          msg = "Truncated MSP file in row map"
          raise OSError(msg) from e
  
      for x, rowlen in enumerate(rowmap):
          try:
              if rowlen == 0:
                  img.write(blank_line)
                  continue
              row = self.fd.read(rowlen)
              if len(row) != rowlen:
                  msg = f"Truncated MSP file, expected {rowlen} bytes on row {x}"
                  raise OSError(msg)
              idx = 0
              while idx < rowlen:
                  runtype = row[idx]
                  idx += 1
                  if runtype == 0:
                      (runcount, runval) = struct.unpack_from(
                          "Bc", row, idx
                      )
                      img.write(runval * runcount)
                      idx += 2
                  else:
                      runcount = runtype
                      img.write(row[idx : idx + runcount])
                      idx += runcount
  
          except struct.error as e:
              msg = f"Corrupted MSP file in row {x}"
              raise OSError(msg) from e
  
      self.set_as_raw(img.getvalue(), ("1", 0, 1))
  
      return -1, 0
  
file_path: pillow/src/PIL/MspImagePlugin.py
imports: from __future__ import annotations
  import io
  import struct
  from .None import Image, ImageFile
  from ._binary import i16le
  from ._binary import o16le
label_desc: Use image node_id 1 for calling the MspDecoder obj's underlying member method code with example usage: obj.decode(buffer) and returns: unknown,  int