mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-13 19:05:37 +00:00
avfilter/vf_signature: Fix leak of string upon error
If an error happens between allocating a string intended to be used as an inpad's name and attaching it to its input pad, the string leaks. Fix this by inserting the inpad directly after allocating its string. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
37838417b8
commit
16ea88778e
1 changed files with 4 additions and 5 deletions
|
|
@ -663,6 +663,10 @@ static av_cold int init(AVFilterContext *ctx)
|
|||
|
||||
if (!pad.name)
|
||||
return AVERROR(ENOMEM);
|
||||
if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) {
|
||||
av_freep(&pad.name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
sc = &(sic->streamcontexts[i]);
|
||||
|
||||
|
|
@ -679,11 +683,6 @@ static av_cold int init(AVFilterContext *ctx)
|
|||
sc->coarseend = sc->coarsesiglist;
|
||||
sc->coarsecount = 0;
|
||||
sc->midcoarse = 0;
|
||||
|
||||
if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) {
|
||||
av_freep(&pad.name);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* check filename */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue