Commit adfc3b81 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dvbsubdec: use av_freep() to avoid leaving stale pointers

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 25a36028
...@@ -313,14 +313,14 @@ static void delete_region_display_list(DVBSubContext *ctx, DVBSubRegion *region) ...@@ -313,14 +313,14 @@ static void delete_region_display_list(DVBSubContext *ctx, DVBSubRegion *region)
*obj2_ptr = obj2->next; *obj2_ptr = obj2->next;
av_free(obj2); av_freep(&obj2);
} }
} }
} }
region->display_list = display->region_list_next; region->display_list = display->region_list_next;
av_free(display); av_freep(&display);
} }
} }
...@@ -332,7 +332,7 @@ static void delete_cluts(DVBSubContext *ctx) ...@@ -332,7 +332,7 @@ static void delete_cluts(DVBSubContext *ctx)
ctx->clut_list = clut->next; ctx->clut_list = clut->next;
av_free(clut); av_freep(&clut);
} }
} }
...@@ -343,7 +343,7 @@ static void delete_objects(DVBSubContext *ctx) ...@@ -343,7 +343,7 @@ static void delete_objects(DVBSubContext *ctx)
ctx->object_list = object->next; ctx->object_list = object->next;
av_free(object); av_freep(&object);
} }
} }
...@@ -356,8 +356,8 @@ static void delete_regions(DVBSubContext *ctx) ...@@ -356,8 +356,8 @@ static void delete_regions(DVBSubContext *ctx)
delete_region_display_list(ctx, region); delete_region_display_list(ctx, region);
av_free(region->pbuf); av_freep(&region->pbuf);
av_free(region); av_freep(&region);
} }
} }
...@@ -462,7 +462,7 @@ static av_cold int dvbsub_close_decoder(AVCodecContext *avctx) ...@@ -462,7 +462,7 @@ static av_cold int dvbsub_close_decoder(AVCodecContext *avctx)
display = ctx->display_list; display = ctx->display_list;
ctx->display_list = display->next; ctx->display_list = display->next;
av_free(display); av_freep(&display);
} }
return 0; return 0;
...@@ -1312,7 +1312,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx, ...@@ -1312,7 +1312,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
tmp_display_list = display->next; tmp_display_list = display->next;
av_free(display); av_freep(&display);
} }
} }
...@@ -1406,7 +1406,7 @@ static void save_display_set(DVBSubContext *ctx) ...@@ -1406,7 +1406,7 @@ static void save_display_set(DVBSubContext *ctx)
png_save2(filename, pbuf, width, height); png_save2(filename, pbuf, width, height);
av_free(pbuf); av_freep(&pbuf);
} }
fileno_index++; fileno_index++;
......
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