Browse code

avfilter/vf_removelogo: use av_freep() for saftey

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2013/10/12 18:30:51
Showing 1 changed files
... ...
@@ -235,8 +235,8 @@ static int load_mask(uint8_t **mask, int *w, int *h,
235 235
     av_image_copy_plane(*mask, *w, gray_data[0], gray_linesize[0], *w, *h);
236 236
 
237 237
 end:
238
-    av_free(src_data[0]);
239
-    av_free(gray_data[0]);
238
+    av_freep(&src_data[0]);
239
+    av_freep(&gray_data[0]);
240 240
     return ret;
241 241
 }
242 242
 
... ...
@@ -540,9 +540,9 @@ static av_cold void uninit(AVFilterContext *ctx)
540 540
         for (a = 0; a <= s->max_mask_size; a++) {
541 541
             /* Loop through each scanline in a mask. */
542 542
             for (b = -a; b <= a; b++) {
543
-                av_free(s->mask[a][b + a]); /* Free a scanline. */
543
+                av_freep(&s->mask[a][b + a]); /* Free a scanline. */
544 544
             }
545
-            av_free(s->mask[a]);
545
+            av_freep(&s->mask[a]);
546 546
         }
547 547
         /* Free the array of pointers pointing to the masks. */
548 548
         av_freep(&s->mask);