diff mbox series

[FFmpeg-devel,11/22] avformat/sapdec: Check ffurl_get_file_handle() for error

Message ID 20240711233417.1896879-11-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/22] avformat/asfdec_o: Check size of index object | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer July 11, 2024, 11:34 p.m. UTC
Fixes: CID1604506 Overflowed constant

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

Patch

diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c
index 357c0dd5147..d5b5d71c020 100644
--- a/libavformat/sapdec.c
+++ b/libavformat/sapdec.c
@@ -198,6 +198,9 @@  static int sap_fetch_packet(AVFormatContext *s, AVPacket *pkt)
     struct pollfd p = {fd, POLLIN, 0};
     uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
 
+    if (fd < 0)
+        return fd;
+
     if (sap->eof)
         return AVERROR_EOF;