History

lavfi/avf_showspectrum: Fix the memory leak in error handle path

Fix the memory leak in error handle path.

Jun Zhao committed 6 years ago

Commit 46d2a671 parent 02a83e21 file · +2 −3Browse files

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

Unified · Split

libavfilter/avf_showspectrum.c+2−3
@@ -700,16 +700,15 @@ static int draw_legend(AVFilterContext *ctx, int samples) · 699 unmodified lines
700700
701701 drawtext(s->outpicref, 2, outlink->h - 10, "CREATED BY LIBAVFILTER", 0);
702702 drawtext(s->outpicref, outlink->w - 2 - strlen(text) * 10, outlink->h - 10, text, 0);
703+ av_freep(&text);
703704 if (s->stop) {
704− char *text = av_asprintf("Zoom: %d Hz - %d Hz", s->start, s->stop);
705+ text = av_asprintf("Zoom: %d Hz - %d Hz", s->start, s->stop);
705706 if (!text)
706707 return AVERROR(ENOMEM);
707708 drawtext(s->outpicref, outlink->w - 2 - strlen(text) * 10, 3, text, 0);
708709 av_freep(&text);
709710 }
710711
711− av_freep(&text);
712−
713712 dst = s->outpicref->data[0] + (s->start_y - 1) * s->outpicref->linesize[0] + s->start_x - 1;
714713 for (x = 0; x < s->w + 1; x++)
715714 dst[x] = 200;

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