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
673 s->inverse = 1;673 s->inverse = 1;
674 674
675 pad.type = AVMEDIA_TYPE_VIDEO;675 pad.type = AVMEDIA_TYPE_VIDEO;
676 pad.name = av_strdup("main");676 pad.name = "main";
677 pad.config_props = config_input;677 pad.config_props = config_input;
678 if (!pad.name)
679 return AVERROR(ENOMEM);
680 678
681 if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0) {679 if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0)
682 av_freep(&pad.name);
683 return ret;680 return ret;
684 }
685 681
686 if (!s->inplace) {682 if (!s->inplace) {
687 pad.type = AVMEDIA_TYPE_VIDEO;683 pad.type = AVMEDIA_TYPE_VIDEO;
688 pad.name = av_strdup("alpha");684 pad.name = "alpha";
689 pad.config_props = NULL;685 pad.config_props = NULL;
690 if (!pad.name)
691 return AVERROR(ENOMEM);
692 686
693 if ((ret = ff_insert_inpad(ctx, 1, &pad)) < 0) {687 if ((ret = ff_insert_inpad(ctx, 1, &pad)) < 0)
694 av_freep(&pad.name);
695 return ret;688 return ret;
696 }
697 }689 }
698 690
699 return 0;691 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