diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-03-01 18:37:40 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-03-01 18:41:19 +0100 |
commit | 498be38e322ce14e1355d8bc5a3d56e239c56958 (patch) | |
tree | f332cc4618aa8a383d1860efe95d292d05146c71 /libavformat | |
parent | c6c82428af51ab63068234a038564acfd4960eec (diff) | |
download | ffmpeg-498be38e322ce14e1355d8bc5a3d56e239c56958.tar.gz |
avformat/sga: improve probing for valid files
Update variables depending on high four bits of first two bytes.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/sga.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/sga.c b/libavformat/sga.c index 957ca0f4cd..20da423ebf 100644 --- a/libavformat/sga.c +++ b/libavformat/sga.c @@ -75,9 +75,11 @@ static int sga_probe(const AVProbeData *p) if (last_left < 0) return 0; if (sectors && header && last_left == 0) { - if (left <= 8) - return 0; - last_left = left; + if (header >> 12) { + last_left = left; + } else { + last_left = left = header; + } } else if (sectors && header) { left = header; last_left -= left; |