kgdev

Results 13 comments of kgdev

just try to use vegeta attack to simulate high concurrent requests. the server side will return various errors: Caused by: VipsJpeg: Not a JPEG file: starts with 0x52 0x49 Vipvips...

Caused by: VipsJpeg: Corrupt JPEG data: premature end of data segment VipsJpeg: Corrupt JPEG data: 47 extraneous bytes before marker 0xd0 VipsJpeg: Corrupt JPEG data: 1052021 extraneous bytes before marker...

https://github.com/jcupitt/libvips/issues/675

This seems to be a really serious bug.

In vips.go, length := C.size_t(len(buf)) imageBuf := unsafe.Pointer(&buf[0]) --> imageBuf := C.CBytes(buf) err := C.vips_init_image(imageBuf, length, C.int(imageType), &image)

image, imageType, err := loadImage(buf). The buf is garbage collected too early.

runtime.KeepAlive(p) is needed.

Yes, I think it's quite easy to repro.

https://github.com/h2non/bimg/pull/162/files

Sounds like a good option. Anyone has other ideas?