diff mbox series

[FFmpeg-devel,4/8] avformat/mov: Factor offset advancement out in probing

Message ID 20210206172301.11769-4-michael@niedermayer.cc
State Accepted
Commit 1ad6801a61da8aead9a9ba26933e9026b7be3646
Headers show
Series [FFmpeg-devel,1/8] avformat/mov: factor size out of probe code | expand

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 | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Paul B Mahol Feb. 6, 2021, 10:07 p.m. UTC | #1
LGTM
Michael Niedermayer Feb. 10, 2021, 5:58 p.m. UTC | #2
On Sat, Feb 06, 2021 at 11:07:35PM +0100, Paul B Mahol wrote:
> LGTM

will apply

{...]
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 8504e97831..7e634c9ec3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7137,7 +7137,6 @@  static int mov_probe(const AVProbeData *p)
             } else {
                 score = AVPROBE_SCORE_MAX;
             }
-            offset = FFMAX(4, size) + offset;
             break;
         /* those are more common words, so rate then a bit less */
         case MKTAG('e','d','i','w'): /* xdcam files have reverted first tags */
@@ -7146,7 +7145,6 @@  static int mov_probe(const AVProbeData *p)
         case MKTAG('j','u','n','k'):
         case MKTAG('p','i','c','t'):
             score  = FFMAX(score, AVPROBE_SCORE_MAX - 5);
-            offset = FFMAX(4, size) + offset;
             break;
         case MKTAG(0x82,0x82,0x7f,0x7d):
         case MKTAG('s','k','i','p'):
@@ -7154,11 +7152,9 @@  static int mov_probe(const AVProbeData *p)
         case MKTAG('p','r','f','l'):
             /* if we only find those cause probedata is too small at least rate them */
             score  = FFMAX(score, AVPROBE_SCORE_EXTENSION);
-            offset = FFMAX(4, size) + offset;
             break;
-        default:
-            offset = FFMAX(4, size) + offset;
         }
+        offset = FFMAX(4, size) + offset;
     }
     if (score > AVPROBE_SCORE_MAX - 50 && moov_offset != -1) {
         /* moov atom in the header - we should make sure that this is not a