diff mbox series

[FFmpeg-devel,6/8] avformat/mov: Simplify probe offset handling

Message ID 20210206172301.11769-6-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/8] avformat/mov: factor size out of probe code
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Feb. 6, 2021, 5:22 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mov.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paul B Mahol Feb. 6, 2021, 10:10 p.m. UTC | #1
I see no major simplification here. It just changes check and
initialization value.
Is this better solution for something?
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index c945586c29..5440078459 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7103,7 +7103,7 @@  static int mov_probe(const AVProbeData *p)
     int64_t offset;
     uint32_t tag;
     int score = 0;
-    int moov_offset = -1;
+    int moov_offset = 0;
 
     /* check file header */
     offset = 0;
@@ -7160,7 +7160,7 @@  static int mov_probe(const AVProbeData *p)
         }
         offset += size;
     }
-    if (score > AVPROBE_SCORE_MAX - 50 && moov_offset != -1) {
+    if (score > AVPROBE_SCORE_MAX - 50 && moov_offset) {
         /* moov atom in the header - we should make sure that this is not a
          * MOV-packed MPEG-PS */
         offset = moov_offset;