Commit bbe2145
committed
fix(webp): 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 <[email protected]>1 parent 203d669 commit bbe2145
1 file changed
+11
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | 243 | | |
247 | 244 | | |
248 | 245 | | |
| |||
271 | 268 | | |
272 | 269 | | |
273 | 270 | | |
274 | | - | |
275 | 271 | | |
276 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
277 | 281 | | |
278 | 282 | | |
279 | 283 | | |
| |||
0 commit comments