From 09ccf09100b9cb1c718266b3cf2cc68b8e73ebf2 Mon Sep 17 00:00:00 2001 From: Dmitrijs Barbarins Date: Thu, 21 Oct 2021 18:52:07 +0200 Subject: [PATCH] Fix buffer --- read.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/read.go b/read.go index 7a2c66d1..2cc8b905 100644 --- a/read.go +++ b/read.go @@ -272,7 +272,6 @@ func readNativeFrames(d dicomio.Reader, parsedData *Dataset, fc chan<- *frame.Fr image.Frames = make([]frame.Frame, nFrames) //bo := d.ByteOrder() bytesAllocated := bitsAllocated / 8 - pixelBuf := make([]byte, bytesAllocated) frameSize := bytesAllocated * samplesPerPixel * pixelsPerFrame @@ -290,7 +289,7 @@ func readNativeFrames(d dicomio.Reader, parsedData *Dataset, fc chan<- *frame.Fr buf := make([]byte, frameSize) - _, err := io.ReadFull(d, pixelBuf) + _, err := io.ReadFull(d, buf) if err != nil { return nil, bytesRead, fmt.Errorf("could not read uint%d from input: %w", bitsAllocated, err)