Fixes #8235.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -97,8 +97,13 @@ static int request_frame(AVFilterLink *outlink) · 96 unmodified lines | ||
| 97 | 97 | |
| 98 | 98 | ret = ff_request_frame(ctx->inputs[0]); |
| 99 | 99 | |
| 100 | +next: | |
| 100 | 101 | if (ret == AVERROR_EOF && !ctx->is_disabled && s->nb_frames > 0) { |
| 101 | 102 | AVFrame *out = s->frames[s->nb_frames - 1]; |
| 103 | + if (!out) { | |
| 104 | + s->nb_frames--; | |
| 105 | + goto next; | |
| 106 | + } | |
| 102 | 107 | out->pts = s->pts[s->flush_idx++]; |
| 103 | 108 | ret = ff_filter_frame(outlink, out); |
| 104 | 109 | s->frames[s->nb_frames - 1] = NULL; |