mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
avfilter/vsrc_life: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
4d48ea3c4b
commit
b44ae59b70
@ -196,8 +196,8 @@ static int init_pattern_from_file(AVFilterContext *ctx)
|
|||||||
|
|
||||||
if (!(life->buf[0] = av_calloc(life->h * life->w, sizeof(*life->buf[0]))) ||
|
if (!(life->buf[0] = av_calloc(life->h * life->w, sizeof(*life->buf[0]))) ||
|
||||||
!(life->buf[1] = av_calloc(life->h * life->w, sizeof(*life->buf[1])))) {
|
!(life->buf[1] = av_calloc(life->h * life->w, sizeof(*life->buf[1])))) {
|
||||||
av_free(life->buf[0]);
|
av_freep(&life->buf[0]);
|
||||||
av_free(life->buf[1]);
|
av_freep(&life->buf[1]);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,8 +238,8 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
|
|
||||||
if (!(life->buf[0] = av_calloc(life->h * life->w, sizeof(*life->buf[0]))) ||
|
if (!(life->buf[0] = av_calloc(life->h * life->w, sizeof(*life->buf[0]))) ||
|
||||||
!(life->buf[1] = av_calloc(life->h * life->w, sizeof(*life->buf[1])))) {
|
!(life->buf[1] = av_calloc(life->h * life->w, sizeof(*life->buf[1])))) {
|
||||||
av_free(life->buf[0]);
|
av_freep(&life->buf[0]);
|
||||||
av_free(life->buf[1]);
|
av_freep(&life->buf[1]);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
if (life->random_seed == -1)
|
if (life->random_seed == -1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user