Unified · Split
| @@ -67,6 +67,17 @@ static int gif_find_frame_end(GIFParseContext *g, const uint8_t *buf, · 66 unmodified lines | ||
| 67 | 67 | g->state = GIF_EXTENSION; |
| 68 | 68 | g->found_start = pc->frame_start_found = 1; |
| 69 | 69 | } else if (buf[index] == GIF_IMAGE_SEPARATOR) { |
| 70 | + if (g->state != GIF_EXTENSION_BLOCK && g->found_start && | |
| 71 | + g->found_end && g->found_sig) { | |
| 72 | + next = index; | |
| 73 | + g->found_start = pc->frame_start_found = 1; | |
| 74 | + g->found_end = 0; | |
| 75 | + g->index = 0; | |
| 76 | + g->gct_flag = 0; | |
| 77 | + g->gct_size = 0; | |
| 78 | + g->state = GIF_IMAGE; | |
| 79 | + break; | |
| 80 | + } | |
| 70 | 81 | g->state = GIF_IMAGE; |
| 71 | 82 | } else if (buf[index] == GIF_TRAILER) { |
| 72 | 83 | g->state = 0; |