Commit 8c0687ab authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/vf_removelogo: use av_freep() for saftey

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e4d45673
...@@ -235,8 +235,8 @@ static int load_mask(uint8_t **mask, int *w, int *h, ...@@ -235,8 +235,8 @@ static int load_mask(uint8_t **mask, int *w, int *h,
av_image_copy_plane(*mask, *w, gray_data[0], gray_linesize[0], *w, *h); av_image_copy_plane(*mask, *w, gray_data[0], gray_linesize[0], *w, *h);
end: end:
av_free(src_data[0]); av_freep(&src_data[0]);
av_free(gray_data[0]); av_freep(&gray_data[0]);
return ret; return ret;
} }
...@@ -540,9 +540,9 @@ static av_cold void uninit(AVFilterContext *ctx) ...@@ -540,9 +540,9 @@ static av_cold void uninit(AVFilterContext *ctx)
for (a = 0; a <= s->max_mask_size; a++) { for (a = 0; a <= s->max_mask_size; a++) {
/* Loop through each scanline in a mask. */ /* Loop through each scanline in a mask. */
for (b = -a; b <= a; b++) { for (b = -a; b <= a; b++) {
av_free(s->mask[a][b + a]); /* Free a scanline. */ av_freep(&s->mask[a][b + a]); /* Free a scanline. */
} }
av_free(s->mask[a]); av_freep(&s->mask[a]);
} }
/* Free the array of pointers pointing to the masks. */ /* Free the array of pointers pointing to the masks. */
av_freep(&s->mask); av_freep(&s->mask);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment