inlink->channel_layout);
text = av_asprintf("%d Hz | %s", inlink->sample_rate, chlayout_str);
+ if (!text)
+ return AVERROR(ENOMEM);
drawtext(s->outpicref, 2, outlink->h - 10, "CREATED BY LIBAVFILTER", 0);
drawtext(s->outpicref, outlink->w - 2 - strlen(text) * 10, outlink->h - 10, text, 0);
+ av_freep(&text);
if (s->stop) {
- char *text = av_asprintf("Zoom: %d Hz - %d Hz", s->start, s->stop);
+ text = av_asprintf("Zoom: %d Hz - %d Hz", s->start, s->stop);
+ if (!text)
+ return AVERROR(ENOMEM);
drawtext(s->outpicref, outlink->w - 2 - strlen(text) * 10, 3, text, 0);
av_freep(&text);
}
- av_freep(&text);
-
dst = s->outpicref->data[0] + (s->start_y - 1) * s->outpicref->linesize[0] + s->start_x - 1;
for (x = 0; x < s->w + 1; x++)
dst[x] = 200;
for (x = 0; x < s->w && s->single_pic; x+=80) {
float seconds = x * spp / inlink->sample_rate;
char *units = get_time(ctx, seconds, x);
+ if (!units)
+ return AVERROR(ENOMEM);
drawtext(s->outpicref, s->start_x + x - 4 * strlen(units), s->h + s->start_y + 6, units, 0);
drawtext(s->outpicref, s->start_x + x - 4 * strlen(units), s->start_y - 12, units, 0);
for (y = 0; y < s->h && s->single_pic; y+=40) {
float seconds = y * spp / inlink->sample_rate;
char *units = get_time(ctx, seconds, x);
+ if (!units)
+ return AVERROR(ENOMEM);
drawtext(s->outpicref, s->start_x - 8 * strlen(units) - 4, s->start_y + y - 4, units, 0);
av_free(units);
s->xpos = 0;
if (!s->single_pic && (s->sliding != FULLFRAME || s->xpos == 0)) {
if (s->old_pts < outpicref->pts) {
+ AVFrame *clone;
+
if (s->legend) {
char *units = get_time(ctx, insamples->pts /(float)inlink->sample_rate, x);
+ if (!units)
+ return AVERROR(ENOMEM);
if (s->orientation == VERTICAL) {
for (y = 0; y < 10; y++) {
av_free(units);
}
s->old_pts = outpicref->pts;
- ret = ff_filter_frame(outlink, av_frame_clone(s->outpicref));
+ clone = av_frame_clone(s->outpicref);
+ if (!clone)
+ return AVERROR(ENOMEM);
+ ret = ff_filter_frame(outlink, clone);
if (ret < 0)
return ret;
return 0;