From 883d41fb40a8eb00438f596337687e8def4577f1 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 7 Oct 2016 11:21:18 -0700 Subject: [PATCH] gif2webp: fix crash with NULL extension data DGifGetExtension() may successfully return, but the data pointer should still be validated BUG=webp:310 Change-Id: I6cfe617871fef2fe07887e5f48bb20f7ab7cfb35 (cherry picked from commit 806f6279aef4de8deca01c8e727db4a508716e95) --- examples/gif2webp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/gif2webp.c b/examples/gif2webp.c index b6a9964b..8c0a5851 100644 --- a/examples/gif2webp.c +++ b/examples/gif2webp.c @@ -359,6 +359,8 @@ int main(int argc, const char *argv[]) { if (DGifGetExtension(gif, &extension, &data) == GIF_ERROR) { goto End; } + if (data == NULL) continue; + switch (extension) { case COMMENT_EXT_FUNC_CODE: { break; // Do nothing for now.