diff mbox series

[FFmpeg-devel,5/9] avformat/img2dec: Little JFIF / Exif cleanup

Message ID 20240603021526.2372698-5-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/9] avdevice/xcbgrab: Check sscanf() return | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer June 3, 2024, 2:15 a.m. UTC
This changes the behavior and makes it behave how it probably was intended.
Either way this is unlikely to result in any user visible change

Fixes: CID1494637 Missing break in switch

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

Patch

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index f8c1c0f3136..ba523530745 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -795,11 +795,13 @@  static int jpeg_probe(const AVProbeData *p)
             state = EOI;
             break;
         case APP0:
-            if (AV_RL32(&b[i + 4]) == MKTAG('J','F','I','F'))
+            if (c == APP0 && AV_RL32(&b[i + 4]) == MKTAG('J','F','I','F'))
                 got_header = 1;
+            /* fallthrough */
         case APP1:
-            if (AV_RL32(&b[i + 4]) == MKTAG('E','x','i','f'))
+            if (c == APP1 && AV_RL32(&b[i + 4]) == MKTAG('E','x','i','f'))
                 got_header = 1;
+            /* fallthrough */
         case APP2:
         case APP3:
         case APP4: