Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

Commit

Permalink
Fixed off-by-one error found by Nico
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Mar 28, 2014
1 parent 73532bd commit 0bba5f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gifwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ struct selected_node {
struct selected_node gfc_lookup_lossy(Gif_Node *work_node, Gif_CodeTable *gfc, const Gif_Colormap *gfcm, Gif_Image *gfi, unsigned pos, unsigned long base_diff, struct rgb dither, const int max_diff)
{
unsigned image_endpos = gfi->width * gfi->height;
if (pos >= image_endpos) return (struct selected_node){work_node, pos, base_diff};
if (pos >= image_endpos) return (struct selected_node){work_node, pos+1, base_diff};

struct selected_node best_t = {work_node, pos+1, base_diff}, t;
Gif_Node *node = work_node;
Expand Down Expand Up @@ -411,7 +411,7 @@ write_compressed_data(Gif_Stream *gfs, Gif_Image *gfi,
output_code = CLEAR_CODE;
/* Because output_code is clear_code, we'll initialize next_code, et al.
below. */

Gif_Colormap *gfcm;

pos = clear_pos = clear_bufpos = 0;
Expand Down

0 comments on commit 0bba5f0

Please sign in to comment.