mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
lavfi/thumbnail: replace frame unref with free.
Fixes memleak spotted by FATE.
This commit is contained in:
parent
f7ab23b0d0
commit
2b27f7fb04
@ -113,7 +113,7 @@ static AVFrame *get_best_frame(AVFilterContext *ctx)
|
|||||||
for (i = 0; i < nb_frames; i++) {
|
for (i = 0; i < nb_frames; i++) {
|
||||||
memset(thumb->frames[i].histogram, 0, sizeof(thumb->frames[i].histogram));
|
memset(thumb->frames[i].histogram, 0, sizeof(thumb->frames[i].histogram));
|
||||||
if (i != best_frame_idx)
|
if (i != best_frame_idx)
|
||||||
av_frame_unref(thumb->frames[i].buf);
|
av_frame_free(&thumb->frames[i].buf);
|
||||||
}
|
}
|
||||||
thumb->n = 0;
|
thumb->n = 0;
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ static av_cold void uninit(AVFilterContext *ctx)
|
|||||||
int i;
|
int i;
|
||||||
ThumbContext *thumb = ctx->priv;
|
ThumbContext *thumb = ctx->priv;
|
||||||
for (i = 0; i < thumb->n_frames && thumb->frames[i].buf; i++)
|
for (i = 0; i < thumb->n_frames && thumb->frames[i].buf; i++)
|
||||||
av_frame_unref(thumb->frames[i].buf);
|
av_frame_free(&thumb->frames[i].buf);
|
||||||
av_freep(&thumb->frames);
|
av_freep(&thumb->frames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user