History

avcodec/hw_base_encode: Simplify EOF check

Found while reviewing CID1608712 Explicit null dereferenced

Michael Niedermayer committed 2 years ago

Commit 1e888fb1 parent b2aaeb81 file · +3 −4Browse files

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

Unified · Split

libavcodec/hw_base_encode.c+3−4
@@ -546,11 +546,10 @@ start: · 545 unmodified lines
546546 }
547547
548548 err = ff_encode_get_frame(avctx, frame);
549− if (err < 0 && err != AVERROR_EOF)
550− return err;
551−
552− if (err == AVERROR_EOF)
549+ if (err == AVERROR_EOF) {
553550 frame = NULL;
551+ } else if (err < 0)
552+ return err;
554553
555554 err = hw_base_encode_send_frame(avctx, ctx, frame);
556555 if (err < 0)

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