History

avfilter/vf_premultiply: Fix leak of names of inpads

These names leak because freeing them in the uninit function has been forgotten. Instead of adding the freeing code, this commit stops allocating these names. They are constants anyway.

Andreas Rheinhardt committed 6 years ago

Commit 7e736cd1 parent 080d2c61 file · +4 −12Browse files

Unified · Split

libavfilter/vf_premultiply.c+4−12
@@ -673,27 +673,19 @@ static av_cold int init(AVFilterContext *ctx) · 672 unmodified lines
673673 s->inverse = 1;
674674
675675 pad.type = AVMEDIA_TYPE_VIDEO;
676− pad.name = av_strdup("main");
676+ pad.name = "main";
677677 pad.config_props = config_input;
678− if (!pad.name)
679− return AVERROR(ENOMEM);
680678
681− if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0) {
682− av_freep(&pad.name);
679+ if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0)
683680 return ret;
684− }
685681
686682 if (!s->inplace) {
687683 pad.type = AVMEDIA_TYPE_VIDEO;
688− pad.name = av_strdup("alpha");
684+ pad.name = "alpha";
689685 pad.config_props = NULL;
690− if (!pad.name)
691− return AVERROR(ENOMEM);
692686
693− if ((ret = ff_insert_inpad(ctx, 1, &pad)) < 0) {
694− av_freep(&pad.name);
687+ if ((ret = ff_insert_inpad(ctx, 1, &pad)) < 0)
695688 return ret;
696− }
697689 }
698690
699691 return 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t