summaryrefslogtreecommitdiff
path: root/libavcodec/dvdsubdec.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2011-06-06 14:13:02 +0200
committerDiego Biurrun <diego@biurrun.de>2012-03-28 09:38:33 +0200
commita92be9b856bd11b081041c43c25d442028fe9a63 (patch)
tree32f852fdf904a30238c789e57510be710eaa7826 /libavcodec/dvdsubdec.c
parent856c8e0a049dc7069b7504d3aaa48549c75852de (diff)
downloadffmpeg-a92be9b856bd11b081041c43c25d442028fe9a63.tar.gz
Replace memset(0) by zero initializations.
Also remove one pointless zero initialization in rangecoder.c.
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-rw-r--r--libavcodec/dvdsubdec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index ee9331cabe..83e71d1238 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -120,13 +120,12 @@ static void guess_palette(uint32_t *rgba_palette,
uint8_t *alpha,
uint32_t subtitle_color)
{
- uint8_t color_used[16];
+ uint8_t color_used[16] = { 0 };
int nb_opaque_colors, i, level, j, r, g, b;
for(i = 0; i < 4; i++)
rgba_palette[i] = 0;
- memset(color_used, 0, 16);
nb_opaque_colors = 0;
for(i = 0; i < 4; i++) {
if (alpha[i] != 0 && !color_used[colormap[i]]) {
@@ -371,14 +370,13 @@ static int is_transp(const uint8_t *buf, int pitch, int n,
/* return 0 if empty rectangle, 1 if non empty */
static int find_smallest_bounding_rectangle(AVSubtitle *s)
{
- uint8_t transp_color[256];
+ uint8_t transp_color[256] = { 0 };
int y1, y2, x1, x2, y, w, h, i;
uint8_t *bitmap;
if (s->num_rects == 0 || s->rects == NULL || s->rects[0]->w <= 0 || s->rects[0]->h <= 0)
return 0;
- memset(transp_color, 0, 256);
for(i = 0; i < s->rects[0]->nb_colors; i++) {
if ((((uint32_t*)s->rects[0]->pict.data[1])[i] >> 24) == 0)
transp_color[i] = 1;