-
Notifications
You must be signed in to change notification settings - Fork 653
fix(webp): Move write_complete_data() to close() for proper scanline … #4973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(webp): Move write_complete_data() to close() for proper scanline … #4973
Conversation
|
|
jessey-git
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just have 1 comment.
bbe2145 to
eee49f9
Compare
|
The CI failures with messages about filling the disk are unrelated to this PR. If you rebase on the current main (or cherry pick #4974 into this PR), it will contain the fix and hopefully everything else will pass. |
…order support The WebP output plugin incorrectly assumed that scanlines would be written in sequential order, triggering the final write when y == height - 1. This violated the write_scanline API contract which allows scanlines to be written in any order (the plugin even advertises 'random_access' support). Changes: - Remove premature write_complete_data() call from write_scanline() - Move final encoding/writing to close() where it belongs - Move buffer cleanup to after write_complete_data() in close() The ioproxy_opened() check already guards against double-close, so no additional state tracking is needed. Fixes the issue where writing scanlines out of order would result in incomplete or corrupted WebP files. Signed-off-by: pmady <pavan4devops@gmail.com>
eee49f9 to
9dad196
Compare
jessey-git
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks alright to me now.
…twareFoundation#4973) Move write_complete_data() to close() for proper scanline order support The WebP output plugin incorrectly assumed that scanlines would be written in sequential order, triggering the final write when y == height - 1. This violated the write_scanline API contract which allows scanlines to be written in any order (the plugin even advertises 'random_access' support). Changes: - Remove premature write_complete_data() call from write_scanline() - Move final encoding/writing to close() where it belongs - Add m_image_complete flag to track write state - Move buffer cleanup to after write_complete_data() in close() Fixes the issue where writing scanlines out of order would result in incomplete or corrupted WebP files. Signed-off-by: pmady <pavan4devops@gmail.com>
…order support
The WebP output plugin incorrectly assumed that scanlines would be written in sequential order, triggering the final write when y == height - 1. This violated the write_scanline API contract which allows scanlines to be written in any order (the plugin even advertises 'random_access' support).
Changes:
Fixes the issue where writing scanlines out of order would result in incomplete or corrupted WebP files.
Description
Tests
Checklist:
need to update the documentation, for example if this is a bug fix that
doesn't change the API.)
(adding new test cases if necessary).
corresponding Python bindings (and if altering ImageBufAlgo functions, also
exposed the new functionality as oiiotool options).
already run clang-format before submitting, I definitely will look at the CI
test that runs clang-format and fix anything that it highlights as being
nonconforming.