diff mbox series

[FFmpeg-devel,v2] avformat/img2dec: assert no pipe on ts_from_file

Message ID 20240607190039.1731735-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,v2] avformat/img2dec: assert no pipe on ts_from_file | expand

Checks

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

Commit Message

Michael Niedermayer June 7, 2024, 7 p.m. UTC
Help coverity with CID1500302 Uninitialized scalar variable

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

Comments

Michael Niedermayer July 2, 2024, 6:32 p.m. UTC | #1
On Fri, Jun 07, 2024 at 09:00:39PM +0200, Michael Niedermayer wrote:
> Help coverity with CID1500302 Uninitialized scalar variable
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/img2dec.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply

[...]
diff mbox series

Patch

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index ba523530745..20b1bc31f6a 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -25,6 +25,7 @@ 
 #define _DEFAULT_SOURCE
 #define _BSD_SOURCE
 #include <sys/stat.h>
+#include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
 #include "libavutil/log.h"
 #include "libavutil/mem.h"
@@ -504,6 +505,7 @@  int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
     pkt->flags       |= AV_PKT_FLAG_KEY;
     if (s->ts_from_file) {
         struct stat img_stat;
+        av_assert0(!s->is_pipe); // The ts_from_file option is not supported by piped input demuxers
         if (stat(filename, &img_stat)) {
             res = AVERROR(EIO);
             goto fail;