[FFmpeg-devel] [PATCH 2/3] avformat/vivo: improve probing of some files
Michael Niedermayer
michael at niedermayer.cc
Thu Apr 5 03:57:53 EEST 2018
On Wed, Apr 04, 2018 at 10:40:39PM +0200, Paul B Mahol wrote:
> On 4/4/18, Michael Niedermayer <michael at niedermayer.cc> wrote:
> > On Wed, Apr 04, 2018 at 04:09:36PM +0200, Paul B Mahol wrote:
> >> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> >> ---
> >> libavformat/vivo.c | 5 +++--
> >> 1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/libavformat/vivo.c b/libavformat/vivo.c
> >> index c9e9c37f37..6a88a09a01 100644
> >> --- a/libavformat/vivo.c
> >> +++ b/libavformat/vivo.c
> >> @@ -59,9 +59,10 @@ static int vivo_probe(AVProbeData *p)
> >> if (c & 0x80 || length > 1024 || length < 21)
> >> return 0;
> >>
> >> - if (memcmp(buf, "\r\nVersion:Vivo/", 15))
> >> + buf += 2;
> >> + if (memcmp(buf, "Version:Vivo/", 13))
> >> return 0;
> >
> > what is in the 2 bytes that are not checked anymore ?
>
> Irrelevant bytes.
of course, but i was just wondering if this would not be more robust
to skip "n" bytes of whitespace.
That is unless you know it will always be 2 or there are cases
where its not whitespace
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180405/56fabe6c/attachment.sig>
More information about the ffmpeg-devel
mailing list