diff mbox series

[FFmpeg-devel,6/9] avformat/subfile: Assert that whence is a known case

Message ID 20240608231046.3619551-6-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/9] avformat/rtpenc_vc2hq: Check sizes | expand

Checks

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

Commit Message

Michael Niedermayer June 8, 2024, 11:10 p.m. UTC
This may help CID1452449 Uninitialized scalar variable

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

Patch

diff --git a/libavformat/subfile.c b/libavformat/subfile.c
index eedac1524e1..be48ef72ef2 100644
--- a/libavformat/subfile.c
+++ b/libavformat/subfile.c
@@ -18,6 +18,7 @@ 
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
 #include "libavutil/opt.h"
 #include "url.h"
@@ -135,6 +136,8 @@  static int64_t subfile_seek(URLContext *h, int64_t pos, int whence)
     case SEEK_END:
         new_pos = end + pos;
         break;
+    default:
+        av_assert0(0);
     }
     if (new_pos < c->start)
         return AVERROR(EINVAL);