summaryrefslogtreecommitdiff
path: root/core/fxcodec/lgif/fx_gif.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-05-03 10:54:23 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-05-03 15:06:31 +0000
commit1e5a98afd195930de69f7b468a852717722377b6 (patch)
tree1488f109aaab731e5f9703ab2b91d607f0d0b9fe /core/fxcodec/lgif/fx_gif.h
parentf45ade3a0af908a1d6a51c5cc675f81517c9a22a (diff)
downloadpdfium-1e5a98afd195930de69f7b468a852717722377b6.tar.xz
Use enum class GifDecodeStatus instead of integers in fx_gif
Change-Id: If37147f513a87bafb3299a493393a6bc44165dbe Reviewed-on: https://pdfium-review.googlesource.com/4811 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/lgif/fx_gif.h')
-rw-r--r--core/fxcodec/lgif/fx_gif.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/fxcodec/lgif/fx_gif.h b/core/fxcodec/lgif/fx_gif.h
index a77a8a3065..c83368479c 100644
--- a/core/fxcodec/lgif/fx_gif.h
+++ b/core/fxcodec/lgif/fx_gif.h
@@ -115,6 +115,13 @@ typedef struct tagGifPlainText {
CFX_ByteString* string_ptr;
} GifPlainText;
+enum class GifDecodeStatus {
+ Error,
+ Success,
+ Unfinished,
+ InsufficientDestSize, // Only used internally by CGifLZWDecoder::Decode()
+};
+
class CGifLZWDecoder {
public:
struct tag_Table {
@@ -126,7 +133,7 @@ class CGifLZWDecoder {
~CGifLZWDecoder();
void InitTable(uint8_t code_len);
- int32_t Decode(uint8_t* des_buf, uint32_t* des_size);
+ GifDecodeStatus Decode(uint8_t* des_buf, uint32_t* des_size);
void Input(uint8_t* src_buf, uint32_t src_size);
uint32_t GetAvailInput();
@@ -209,10 +216,11 @@ struct tag_gif_decompress_struct {
gif_decompress_struct_p gif_create_decompress();
void gif_destroy_decompress(gif_decompress_struct_pp gif_ptr_ptr);
-int32_t gif_read_header(gif_decompress_struct_p gif_ptr);
-int32_t gif_get_frame(gif_decompress_struct_p gif_ptr);
+GifDecodeStatus gif_read_header(gif_decompress_struct_p gif_ptr);
+GifDecodeStatus gif_get_frame(gif_decompress_struct_p gif_ptr);
int32_t gif_get_frame_num(gif_decompress_struct_p gif_ptr);
-int32_t gif_load_frame(gif_decompress_struct_p gif_ptr, int32_t frame_num);
+GifDecodeStatus gif_load_frame(gif_decompress_struct_p gif_ptr,
+ int32_t frame_num);
void gif_input_buffer(gif_decompress_struct_p gif_ptr,
uint8_t* src_buf,
uint32_t src_size);