exiv2 icon indicating copy to clipboard operation
exiv2 copied to clipboard

Question about WebPImage::inject_VP8X

Open kevinbackhouse opened this issue 2 years ago • 2 comments

Does anybody here know why this -1 adjustment is needed in WebPImage::inject_VP8X?

https://github.com/Exiv2/exiv2/blob/a5c521ea572fb7c3eba3437cf9b77e62bf39c19e/src/webpimage.cpp#L764

Most of the time, it looks like it's cancelling the corresponding +1 adjustments in WebPImage::doWriteMetadata, like this one:

https://github.com/Exiv2/exiv2/blob/a5c521ea572fb7c3eba3437cf9b77e62bf39c19e/src/webpimage.cpp#L267

But there's no +1 adjustment here:

https://github.com/Exiv2/exiv2/blob/a5c521ea572fb7c3eba3437cf9b77e62bf39c19e/src/webpimage.cpp#L215

Which means that I can create a poc that causes w to be negative in WebPImage::inject_VP8X. Is that a bug? To run the poc:

exiv2 rm poc.webp

Nothing visibly bad happens. You need to set a breakpoint in WebPImage::inject_VP8X to see that w == -1.

kevinbackhouse avatar Jul 06 '22 13:07 kevinbackhouse

No idea from my side 😅

piponazo avatar Jul 08 '22 05:07 piponazo

width being negative sounds like a bug 🤷

neheb avatar Aug 04 '22 23:08 neheb