History

avfilter/vf_colorconstancy: fix memory leak on error

Also remove unneeded log message while here.

Paul B Mahol committed 6 years ago

Commit 32ea6ff1 parent dfc47141 file · +1 −3Browse files

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

Unified · Split

libavfilter/vf_colorconstancy.c+1−3
@@ -121,7 +121,6 @@ static int set_gauss(AVFilterContext *ctx) · 120 unmodified lines
121121 for (; i >= 0; --i) {
122122 av_freep(&s->gauss[i]);
123123 }
124− av_log(ctx, AV_LOG_ERROR, "Out of memory while allocating gauss buffers.\n");
125124 return AVERROR(ENOMEM);
126125 }
127126 }
@@ -223,7 +222,6 @@ static int setup_derivative_buffers(AVFilterContext* ctx, ThreadData *td) · 95 unmodified lines
223222 td->data[b][p] = av_mallocz_array(s->planeheight[p] * s->planewidth[p], sizeof(*td->data[b][p]));
224223 if (!td->data[b][p]) {
225224 cleanup_derivative_buffers(td, b + 1, p);
226− av_log(ctx, AV_LOG_ERROR, "Out of memory while allocating derivatives buffers.\n");
227225 return AVERROR(ENOMEM);
228226 }
229227 }
@@ -696,7 +694,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 466 unmodified lines
696694 } else {
697695 out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
698696 if (!out) {
699− av_log(ctx, AV_LOG_ERROR, "Out of memory while allocating output video buffer.\n");
697+ av_frame_free(&in);
700698 return AVERROR(ENOMEM);
701699 }
702700 av_frame_copy_props(out, in);

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