History

avfilter/vf_colorspace: fix memmory leaks

Fixes #8303

Paul B Mahol committed 7 years ago

Commit fddef961 parent daf2bef1 file · +11 −2Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_colorspace.c+11−2
@@ -780,6 +780,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 779 unmodified lines
780 res = av_frame_copy_props(out, in);780 res = av_frame_copy_props(out, in);
781 if (res < 0) {781 if (res < 0) {
782 av_frame_free(&in);782 av_frame_free(&in);
783 av_frame_free(&out);
783 return res;784 return res;
784 }785 }
785 786
@@ -839,13 +840,18 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 53 unmodified lines
839 !s->dither_scratch_base[1][0] || !s->dither_scratch_base[1][1] ||840 !s->dither_scratch_base[1][0] || !s->dither_scratch_base[1][1] ||
840 !s->dither_scratch_base[2][0] || !s->dither_scratch_base[2][1]) {841 !s->dither_scratch_base[2][0] || !s->dither_scratch_base[2][1]) {
841 uninit(ctx);842 uninit(ctx);
843 av_frame_free(&in);
844 av_frame_free(&out);
842 return AVERROR(ENOMEM);845 return AVERROR(ENOMEM);
843 }846 }
844 s->rgb_sz = rgb_sz;847 s->rgb_sz = rgb_sz;
845 }848 }
846 res = create_filtergraph(ctx, in, out);849 res = create_filtergraph(ctx, in, out);
847 if (res < 0)850 if (res < 0) {
851 av_frame_free(&in);
852 av_frame_free(&out);
848 return res;853 return res;
854 }
849 s->rgb_stride = rgb_stride / sizeof(int16_t);855 s->rgb_stride = rgb_stride / sizeof(int16_t);
850 td.in = in;856 td.in = in;
851 td.out = out;857 td.out = out;
@@ -859,8 +865,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 7 unmodified lines
859 td.out_ss_h = av_pix_fmt_desc_get(out->format)->log2_chroma_h;865 td.out_ss_h = av_pix_fmt_desc_get(out->format)->log2_chroma_h;
860 if (s->yuv2yuv_passthrough) {866 if (s->yuv2yuv_passthrough) {
861 res = av_frame_copy(out, in);867 res = av_frame_copy(out, in);
862 if (res < 0)868 if (res < 0) {
869 av_frame_free(&in);
870 av_frame_free(&out);
863 return res;871 return res;
872 }
864 } else {873 } else {
865 ctx->internal->execute(ctx, convert, &td, NULL,874 ctx->internal->execute(ctx, convert, &td, NULL,
866 FFMIN((in->height + 1) >> 1, ff_filter_get_nb_threads(ctx)));875 FFMIN((in->height + 1) >> 1, ff_filter_get_nb_threads(ctx)));

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