diff --git a/src/pixie/fileformats/jpeg.nim b/src/pixie/fileformats/jpeg.nim index 71c60d7..29ee736 100644 --- a/src/pixie/fileformats/jpeg.nim +++ b/src/pixie/fileformats/jpeg.nim @@ -1020,7 +1020,7 @@ proc decodeJpeg*(data: string): Image {.raises: [PixieError].} = ## Decodes the JPEG into an Image. var state = DecoderState() - state.buffer = cast[ptr UncheckedArray[uint8]](data[0].unsafeAddr) + state.buffer = cast[ptr UncheckedArray[uint8]](data.cstring) state.len = data.len while true: