From a92be9b856bd11b081041c43c25d442028fe9a63 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 6 Jun 2011 14:13:02 +0200 Subject: Replace memset(0) by zero initializations. Also remove one pointless zero initialization in rangecoder.c. --- libavcodec/dvdsubdec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libavcodec/dvdsubdec.c') 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; -- cgit v1.2.3