aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-03 22:13:33 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-03 22:13:35 +0200
commit70d01f1f5699e265f79985b61136a62f9fa18a49 (patch)
treea302ed2f47e173aa54159c21fe78aae9e2a65665
parent85362d58c120a7bd121f68506fe5afad7071c29b (diff)
Make gif rendering more robust
-rw-r--r--src/Gif.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Gif.cpp b/src/Gif.cpp
index 7a80f86..c79153c 100644
--- a/src/Gif.cpp
+++ b/src/Gif.cpp
@@ -169,7 +169,10 @@ namespace dchat
u32 i = currentFrame % gif.frame_count;
gif_result code = gif_decode_frame(&gif, i);
if(code != GIF_OK)
+ {
printf("Warning: gif_decode_frame: %s\n", gifResultToString(code));
+ break;
+ }
gif_frame &frame = gif.frames[i];
// frame_delay is in centiseconds