const int nb_samples = frame->nb_samples;
AVFrame *out_frame;
int chan, i;
+ int err;
if (av_frame_is_writable(frame)) {
out_frame = frame;
av_frame_free(&frame);
return AVERROR(ENOMEM);
}
- av_frame_copy_props(out_frame, frame);
+ err = av_frame_copy_props(out_frame, frame);
+ if (err < 0) {
+ av_frame_free(&out_frame);
+ av_frame_free(&frame);
+ return err;
+ }
}
for (chan = 0; chan < channels; chan++) {
const int nb_samples = frame->nb_samples;
int chan, i, av_uninit(dindex), oindex, av_uninit(count);
AVFrame *out_frame = NULL;
+ int err;
if (s->pts == AV_NOPTS_VALUE) {
s->pts = (frame->pts == AV_NOPTS_VALUE) ? 0 : frame->pts;
av_frame_free(&frame);
return AVERROR(ENOMEM);
}
- av_frame_copy_props(out_frame, frame);
+ err = av_frame_copy_props(out_frame, frame);
+ if (err < 0) {
+ av_frame_free(&out_frame);
+ av_frame_free(&frame);
+ return err;
+ }
out_frame->pts = s->pts;
s->pts += av_rescale_q(nb_samples - i,
(AVRational){ 1, inlink->sample_rate },
double radius = s->curve_dB * M_LN10 / 20;
int nb_attacks, nb_decays, nb_points;
char *p, *saveptr = NULL;
+ const int channels = outlink->channels;
int new_nb_items, num;
int i;
int err;
count_items(s->decays, &nb_decays);
count_items(s->points, &nb_points);
+ if (channels <= 0) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid number of channels: %d\n", channels);
+ return AVERROR(EINVAL);
+ }
+
if ((nb_attacks > outlink->channels) || (nb_decays > outlink->channels)) {
av_log(ctx, AV_LOG_ERROR, "Number of attacks/decays bigger than number of channels.\n");
return AVERROR(EINVAL);