From e83cbde1a4b816a64cefde1fb8bdbac403079600 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 23 Jul 2013 00:45:23 +0200 Subject: Fix some -Wshadow warnings In general, this warning can hint to actual bugs. We don't enable it yet, because it would conflict with some unmerged code, and we should check with clang too (this commit was done by testing with gcc). --- demux/ebml.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'demux/ebml.c') diff --git a/demux/ebml.c b/demux/ebml.c index 98ab1ef306..2314121f5e 100644 --- a/demux/ebml.c +++ b/demux/ebml.c @@ -459,12 +459,12 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target, level, " ", type->name); char *s = target; - int len; uint8_t *end = data + size; uint8_t *p = data; int num_elems[MAX_EBML_SUBELEMENTS] = {}; while (p < end) { uint8_t *startp = p; + int len; uint32_t id = ebml_parse_id(p, &len); if (len > end - p) goto past_end_error; @@ -523,9 +523,8 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target, case EBML_TYPE_SUBELEMENTS: num_elems[i] = FFMIN(num_elems[i], 1000000000 / type->fields[i].desc->size); - int size = num_elems[i] * type->fields[i].desc->size; - *(generic_struct **) ptr = talloc_zero_size(ctx->talloc_ctx, - size); + int sz = num_elems[i] * type->fields[i].desc->size; + *(generic_struct **) ptr = talloc_zero_size(ctx->talloc_ctx, sz); break; case EBML_TYPE_UINT: *(uint64_t **) ptr = talloc_zero_array(ctx->talloc_ctx, -- cgit v1.2.3