History

avfilter/vf_dedot: fix crash

Fixes #8299

Paul B Mahol committed 7 years ago

Commit 8f63c4e1 parent ce401881 file · +6 −2Browse files

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

Unified · Split

libavfilter/vf_dedot.c+6−2
@@ -283,7 +283,7 @@ static int activate(AVFilterContext *ctx) · 282 unmodified lines
283283 s->frames[i] = av_frame_clone(frame);
284284 }
285285 av_frame_free(&frame);
286− } else {
286+ } else if (s->frames[3]) {
287287 s->eof_frames--;
288288 s->frames[4] = av_frame_clone(s->frames[3]);
289289 }
@@ -343,7 +343,11 @@ static int activate(AVFilterContext *ctx) · 53 unmodified lines
343343 if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) {
344344 if (status == AVERROR_EOF) {
345345 s->eof = 1;
346− s->eof_frames = 2;
346+ s->eof_frames = !!s->frames[0] + !!s->frames[1];
347+ if (s->eof_frames <= 0) {
348+ ff_outlink_set_status(outlink, AVERROR_EOF, pts);
349+ return 0;
350+ }
347351 ff_filter_set_ready(ctx, 10);
348352 return 0;
349353 }

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