diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-07-05 02:21:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-07-12 22:42:25 +0200 |
commit | 1e888fb006daf1edb5d853de2f66a6caeb2dce13 (patch) | |
tree | 10a2332cb16d29e0d95361beb2fbc786f24f0cca /libavcodec | |
parent | b2aaeb81f65aaa61238d74a77034b118055340d3 (diff) | |
download | ffmpeg-1e888fb006daf1edb5d853de2f66a6caeb2dce13.tar.gz |
avcodec/hw_base_encode: Simplify EOF check
Found while reviewing CID1608712 Explicit null dereferenced
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/hw_base_encode.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/hw_base_encode.c b/libavcodec/hw_base_encode.c index ecb4be6aa4..6d5632c298 100644 --- a/libavcodec/hw_base_encode.c +++ b/libavcodec/hw_base_encode.c @@ -546,11 +546,10 @@ start: } err = ff_encode_get_frame(avctx, frame); - if (err < 0 && err != AVERROR_EOF) - return err; - - if (err == AVERROR_EOF) + if (err == AVERROR_EOF) { frame = NULL; + } else if (err < 0) + return err; err = hw_base_encode_send_frame(avctx, ctx, frame); if (err < 0) |