Browse Source

avfilter/vf_removelogo: use av_malloc_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.3
Michael Niedermayer 11 years ago
parent
commit
6ab37221c8
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      libavfilter/vf_removelogo.c

+ 3
- 3
libavfilter/vf_removelogo.c View File

@@ -312,18 +312,18 @@ static av_cold int init(AVFilterContext *ctx)
the filter is applied, the mask size is determined on a pixel
by pixel basis, with pixels nearer the edge of the logo getting
smaller mask sizes. */
mask = (int ***)av_malloc(sizeof(int **) * (s->max_mask_size + 1));
mask = (int ***)av_malloc_array(s->max_mask_size + 1, sizeof(int **));
if (!mask)
return AVERROR(ENOMEM);

for (a = 0; a <= s->max_mask_size; a++) {
mask[a] = (int **)av_malloc(sizeof(int *) * ((a * 2) + 1));
mask[a] = (int **)av_malloc_array((a * 2) + 1, sizeof(int *));
if (!mask[a]) {
av_free(mask);
return AVERROR(ENOMEM);
}
for (b = -a; b <= a; b++) {
mask[a][b + a] = (int *)av_malloc(sizeof(int) * ((a * 2) + 1));
mask[a][b + a] = (int *)av_malloc_array((a * 2) + 1, sizeof(int));
if (!mask[a][b + a]) {
av_free(mask);
return AVERROR(ENOMEM);


Loading…
Cancel
Save