mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
imageviewer: Fix potential null pointer dereference
(caught by clang-analyzer) Change-Id: Ie24b7cd75c5e9814007674925f33b1a321f1d06d
This commit is contained in:
parent
7fb438b06c
commit
c1485455ea
1 changed files with 6 additions and 4 deletions
|
|
@ -136,7 +136,7 @@ static void set_canvas_background(pixel_t *out, GifFileType *GifFile)
|
||||||
* to reset canvas to global background color specified in gif BUT
|
* to reset canvas to global background color specified in gif BUT
|
||||||
* all renderers I know use transparency instead.
|
* all renderers I know use transparency instead.
|
||||||
*/
|
*/
|
||||||
memset(out, PIXEL_TRANSPARENT, PIXELS_SZ);
|
memset(out, PIXEL_TRANSPARENT, PIXELS_SZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* var names adhere to giflib coding style */
|
/* var names adhere to giflib coding style */
|
||||||
|
|
@ -282,7 +282,8 @@ void gif_decode(struct gif_decoder *d,
|
||||||
Row + j, Col, Width);
|
Row + j, Col, Width);
|
||||||
}
|
}
|
||||||
|
|
||||||
pf_progress(25*(i+1), 100);
|
if (pf_progress != NULL)
|
||||||
|
pf_progress(25*(i+1), 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -299,7 +300,8 @@ void gif_decode(struct gif_decoder *d,
|
||||||
gif2pixels(Line, pixels_buffer[buf_idx],
|
gif2pixels(Line, pixels_buffer[buf_idx],
|
||||||
Row + i, Col, Width);
|
Row + i, Col, Width);
|
||||||
|
|
||||||
pf_progress(100*(i+1)/Height, 100);
|
if (pf_progress != NULL)
|
||||||
|
pf_progress(25*(i+1), 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -406,7 +408,7 @@ void gif_decode(struct gif_decoder *d,
|
||||||
free(pixels_buffer[1]);
|
free(pixels_buffer[1]);
|
||||||
|
|
||||||
free(Line);
|
free(Line);
|
||||||
|
|
||||||
/* WARNING !!!! */
|
/* WARNING !!!! */
|
||||||
/* GifFile object is trashed from now on, DONT use it */
|
/* GifFile object is trashed from now on, DONT use it */
|
||||||
/* Move bitmap in native format to the front of the buff */
|
/* Move bitmap in native format to the front of the buff */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue