lavfi: avoid void* arithmetic in defaults.c:set_common_formats()

void* pointer arithmetic semantics is undefined, use uint8_t* instead.

Also fix GCC warnings:
defaults.c: In function ‘set_common_formats’:
defaults.c:184: warning: pointer of type ‘void *’ used in arithmetic
defaults.c:189: warning: pointer of type ‘void *’ used in arithmetic
pull/2/head
Stefano Sabatini 13 years ago
parent a8dcf5eebb
commit 3c56a421d8
  1. 4
      libavfilter/defaults.c

@ -181,12 +181,12 @@ static void set_common_formats(AVFilterContext *ctx, AVFilterFormats *fmts,
for (i = 0; i < ctx->input_count; i++)
if (ctx->inputs[i] && ctx->inputs[i]->type == type)
avfilter_formats_ref(fmts,
(AVFilterFormats**)((void*)ctx->inputs[i]+offout));
(AVFilterFormats **)((uint8_t *)ctx->inputs[i]+offout));
for (i = 0; i < ctx->output_count; i++)
if (ctx->outputs[i] && ctx->outputs[i]->type == type)
avfilter_formats_ref(fmts,
(AVFilterFormats**)((void*)ctx->outputs[i]+offin));
(AVFilterFormats **)((uint8_t *)ctx->outputs[i]+offin));
if (!fmts->refcount) {
av_free(fmts->formats);

Loading…
Cancel
Save