vncproxy icon indicating copy to clipboard operation
vncproxy copied to clipboard

raw encoding should return the buff

Open yannliao opened this issue 4 years ago • 0 comments

in raw encoding func (*RawEncoding) Read(...) always return nil buff.

for y := uint16(0); y < rect.Height; y++ {
  for x := uint16(0); x < rect.Width; x++ {
	  if bts, err := r.ReadBytes(bytesPerPixel); err != nil {
		  StoreBytes(bytes, bts)
		  return nil, err
	  }
  }
}

StoreBytes(bytes, bts) should called outside the error assertion :

for y := uint16(0); y < rect.Height; y++ {
  for x := uint16(0); x < rect.Width; x++ {
	  bts, err := r.ReadBytes(bytesPerPixel)
	  if err != nil {
		  return nil, err
	  }
	  StoreBytes(bytes, bts)
  }
}

yannliao avatar Jan 11 '21 12:01 yannliao