diff options
author | Clément Bœsch <ubitux@gmail.com> | 2012-11-29 01:38:08 +0100 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2012-11-29 01:38:08 +0100 |
commit | 782993d9e42462d99fd839bdc0967e006bc0781e (patch) | |
tree | bd242981b3a2f66ca1982bf6c171fed50563fd9a /libavfilter | |
parent | 24f425319d798a4807b76959fc75479fc64f3432 (diff) | |
download | ffmpeg-782993d9e42462d99fd839bdc0967e006bc0781e.tar.gz |
lavfi/thumbnail: use avfilter_unref_bufferp() where appropriate.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_thumbnail.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavfilter/vf_thumbnail.c b/libavfilter/vf_thumbnail.c index beec31c0d5..afaa3b7c03 100644 --- a/libavfilter/vf_thumbnail.c +++ b/libavfilter/vf_thumbnail.c @@ -135,8 +135,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *frame) memset(thumb->frames[i].histogram, 0, sizeof(thumb->frames[i].histogram)); if (i == best_frame_idx) continue; - avfilter_unref_buffer(thumb->frames[i].buf); - thumb->frames[i].buf = NULL; + avfilter_unref_bufferp(&thumb->frames[i].buf); } thumb->n = 0; @@ -152,10 +151,8 @@ static av_cold void uninit(AVFilterContext *ctx) { int i; ThumbContext *thumb = ctx->priv; - for (i = 0; i < thumb->n_frames && thumb->frames[i].buf; i++) { - avfilter_unref_buffer(thumb->frames[i].buf); - thumb->frames[i].buf = NULL; - } + for (i = 0; i < thumb->n_frames && thumb->frames[i].buf; i++) + avfilter_unref_bufferp(&thumb->frames[i].buf); av_freep(&thumb->frames); } |