diff mbox series

[FFmpeg-devel,5/9] avformat/subfile: Merge if into switch()

Message ID 20240608231046.3619551-5-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
Found while reviewing CID1452449 Uninitialized scalar variable

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

Patch

diff --git a/libavformat/subfile.c b/libavformat/subfile.c
index 633a9e3c62c..eedac1524e1 100644
--- a/libavformat/subfile.c
+++ b/libavformat/subfile.c
@@ -123,9 +123,9 @@  static int64_t subfile_seek(URLContext *h, int64_t pos, int whence)
             return end;
     }
 
-    if (whence == AVSEEK_SIZE)
-        return end - c->start;
     switch (whence) {
+    case AVSEEK_SIZE:
+        return end - c->start;
     case SEEK_SET:
         new_pos = c->start + pos;
         break;