qiqian / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

Crash during lossless encoding in v0.2.0 #128

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

On this file: http://imagecompression.info/gralic/PIA13894.webp

First decompress:
dwebp.exe PIA13894.webp -o PIA13894.png
then try any of the following:
cwebp.exe -lossless -m 5 PIA13894.png -o PIA13894.wp5
cwebp.exe -lossless -m 6 PIA13894.png -o PIA13894.wp6

To learn more about the image PIA13894,
visit  http://imagecompression.info/gralic/LPCB.html

Original issue reported on code.google.com by pascal.m...@gmail.com on 25 Sep 2012 at 8:36

Attachments:

GoogleCodeExporter commented 8 years ago
I couldn't reproduce here (MacBook pro), the compression just completed ok:

cwebp PIA13894.png -m 5 -lossless
File:      PIA13894.png
Dimension: 2610 x 4104
Output:    6823212 bytes
Lossless-ARGB compressed size: 6823212 bytes
  * Lossless features used: PREDICTION CROSS-COLOR-TRANSFORM
  * Precision Bits: histogram=7 transform=3 cache=0

cwebp PIA13894.png -m 6 -lossless
File:      PIA13894.png
Dimension: 2610 x 4104
Output:    6823212 bytes
Lossless-ARGB compressed size: 6823212 bytes
  * Lossless features used: PREDICTION CROSS-COLOR-TRANSFORM
  * Precision Bits: histogram=7 transform=3 cache=0

Could it be it's "just" a memory problem?

Original comment by pascal.m...@gmail.com on 25 Sep 2012 at 8:44

GoogleCodeExporter commented 8 years ago
I'd advise to try options in reverse order first,
cwebp.exe -lossless -m 5 PIA13894.png -o PIA13894.wp5

then try the same on Linux, then on Windows. My machine is Windows XP
Pro SP3, with 3Gb RAM. Intel Core i7 CPU.

With -m 0...3 compressed size is 6682232.

Alex

Original comment by gral...@gmail.com on 25 Sep 2012 at 8:53

GoogleCodeExporter commented 8 years ago
Hi Alex,
I tried to run this on my Linux box (Ubuntu 12.04) with order of options you 
specified, and works fine for me too:

cwebp -lossless -m 6 PIA13894.back.png -o PIA13894.back.png.6.webp
Saving file 'PIA13894.back.png.6.webp'
File:      PIA13894.back.png
Dimension: 2610 x 4104
Output:    6823212 bytes
Lossless-ARGB compressed size: 6823212 bytes
  * Lossless features used: PREDICTION CROSS-COLOR-TRANSFORM
  * Precision Bits: histogram=7 transform=3 cache=0

Hopefully, someone with a windows machine will try it next.

Original comment by urv...@google.com on 25 Sep 2012 at 9:39

GoogleCodeExporter commented 8 years ago
I can reproduce this. I'll see about putting a fix together.

Original comment by jz...@google.com on 3 Oct 2012 at 6:37

GoogleCodeExporter commented 8 years ago

Original comment by jz...@google.com on 3 Oct 2012 at 6:38

GoogleCodeExporter commented 8 years ago
This is a problem in all 32-bit builds. There were a couple cases of integer 
overflow, the core issue is fixed by:

https://gerrit.chromium.org/gerrit/#/c/34535/

Original comment by jz...@google.com on 3 Oct 2012 at 7:32

GoogleCodeExporter commented 8 years ago
This commit:
 80237c4 GetHistoBits: fix integer overflow
has been merged (v0.2.0-27-g7fee5d1).

Two additional fixes came out of this:
 a6ae04d VP8LAllocateHistogramSet: fix overflow in size calculation
 8a99723 EncodeImageInternal: fix uninitialized free

Original comment by jz...@google.com on 3 Oct 2012 at 10:38