Don't store CE (comment extension) block data when decoding GIF

GIF extensions are laid out as follows: <size byte> <chunk of data>
<size byte> <chunk of data> ... <terminator byte>. The decoder needs
to scan along the data, finding the size bytes to determine where
the block ends in the stream, even if we don't care about the
content. Currently the decoder is storing all of the data chunks,
which are never used and take a lot of time to concat together if
they are very small.

Our implementation of the GIF spec does not handle this extension, so
when scanning for the end of the block, just don't bother storing
data from it.

BUG=chromium:833168

Change-Id: Iadf3ab3afd8145b6c5c7c22c30fe9316efcafc15
Reviewed-on: https://pdfium-review.googlesource.com/31315
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcodec/gif/cfx_gifcontext.cpp b/core/fxcodec/gif/cfx_gifcontext.cpp
index 66e316b..3bc9546 100644
--- a/core/fxcodec/gif/cfx_gifcontext.cpp
+++ b/core/fxcodec/gif/cfx_gifcontext.cpp
@@ -436,15 +436,11 @@
         return CFX_GifDecodeStatus::Unfinished;
       }
 
-      cmt_data_.clear();
       while (*data_size != GIF_BLOCK_TERMINAL) {
-        uint8_t block_size = *data_size;
         if (!ReadData(&data_buf, *data_size) || !ReadData(&data_size, 1)) {
           skip_size_ = skip_size_org;
           return CFX_GifDecodeStatus::Unfinished;
         }
-
-        cmt_data_ += ByteString(data_buf, block_size);
       }
       break;
     }
diff --git a/core/fxcodec/gif/cfx_gifcontext.h b/core/fxcodec/gif/cfx_gifcontext.h
index ba23522..597af73 100644
--- a/core/fxcodec/gif/cfx_gifcontext.h
+++ b/core/fxcodec/gif/cfx_gifcontext.h
@@ -52,7 +52,6 @@
   uint32_t avail_in_;
   int32_t decode_status_;
   uint32_t skip_size_;
-  ByteString cmt_data_;
   std::unique_ptr<CFX_GifGraphicControlExtension> graphic_control_extension_;
   uint8_t* next_in_;
   std::vector<std::unique_ptr<CFX_GifImage>> images_;