e116a9
diff -up libwebp-0.3.0/src/enc/alpha.c.mozilla-1819244 libwebp-0.3.0/src/enc/alpha.c
e116a9
--- libwebp-0.3.0/src/enc/alpha.c.mozilla-1819244	2013-03-29 23:55:16.000000000 +0100
e116a9
+++ libwebp-0.3.0/src/enc/alpha.c	2023-04-26 12:06:31.017969727 +0200
e116a9
@@ -123,8 +123,8 @@ static int EncodeAlphaInternal(const uin
e116a9
   header = method | (filter << 2);
e116a9
   if (reduce_levels) header |= ALPHA_PREPROCESSED_LEVELS << 4;
e116a9
 
e116a9
-  VP8BitWriterInit(bw, expected_size);
e116a9
-  VP8BitWriterAppend(bw, &header, ALPHA_HEADER_LEN);
e116a9
+  ok = VP8BitWriterInit(bw, expected_size);
e116a9
+  ok = ok && VP8BitWriterAppend(bw, &header, ALPHA_HEADER_LEN);
e116a9
 
e116a9
   filter_func = WebPFilters[filter];
e116a9
   if (filter_func != NULL) {
e116a9
@@ -135,7 +135,7 @@ static int EncodeAlphaInternal(const uin
e116a9
   }
e116a9
 
e116a9
   if (method == ALPHA_NO_COMPRESSION) {
e116a9
-    ok = VP8BitWriterAppend(bw, alpha_src, width * height);
e116a9
+    ok = ok && VP8BitWriterAppend(bw, alpha_src, width * height);
e116a9
     ok = ok && !bw->error_;
e116a9
   } else {
e116a9
     ok = EncodeLossless(alpha_src, width, height, effort_level, bw, stats);