WebpEncoder: respect the return value of write()

If we fail to write to the stream, return false. Use an autodeleter to
ensure the data gets cleaned up. This matches use elsewhere in the file.
Note that WebPMuxAssemble guarantees it will initialize the struct, so
it's safe to call WebPDataClear even on failure.

Bug: 40044782
Change-Id: I74893e137e2516e8e19c1c715772d0f1ba146573
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/813118
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
1 file changed