diff mbox series

[FFmpeg-devel,6/7] tools/decode_simple: Check avcodec_send_packet() for errors on flushing

Message ID 20240521024652.1006233-6-michael@niedermayer.cc
State Accepted
Commit 6df8bd64ffa5ea3864a433c5e78b8d8f642c1305
Headers show
Series [FFmpeg-devel,1/7] avutil/random_seed: Avoid dead returns | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Michael Niedermayer May 21, 2024, 2:46 a.m. UTC
This will not error but the API allows errors so we should check it
Fixes: CID1489999 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 tools/decode_simple.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/decode_simple.c b/tools/decode_simple.c
index 6532e368d46..e8c1d6a407e 100644
--- a/tools/decode_simple.c
+++ b/tools/decode_simple.c
@@ -94,8 +94,9 @@  int ds_run(DecodeContext *dc)
             goto finish;
     }
 
-    avcodec_send_packet(dc->decoder, NULL);
-    ret = decode_read(dc, 1);
+    ret = avcodec_send_packet(dc->decoder, NULL);
+    if (ret >= 0)
+        ret = decode_read(dc, 1);
     if (ret < 0) {
         fprintf(stderr, "Error flushing: %d\n", ret);
         return ret;