[FFmpeg-cvslog] lavf/img2dec: Improve detection of valid Quickdraw images.
Carl Eugen Hoyos
git at videolan.org
Mon Jun 29 17:41:00 CEST 2015
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Mon Jun 29 16:25:11 2015 +0200| [dee7943819042f310d7995671d3e39f4dd31d770] | committer: Carl Eugen Hoyos
lavf/img2dec: Improve detection of valid Quickdraw images.
Detect Quickdraw images without application header with
lower score.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dee7943819042f310d7995671d3e39f4dd31d770
---
libavformat/img2dec.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 772204c..cf848ce 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -725,9 +725,15 @@ static int qdraw_probe(AVProbeData *p)
{
const uint8_t *b = p->buf;
- if (!b[10] && AV_RB32(b+11) == 0x1102ff0c && !b[15] ||
- p->buf_size >= 528 && !b[522] && AV_RB32(b+523) == 0x1102ff0c && !b[527])
- return AVPROBE_SCORE_EXTENSION + 1;
+ if ( p->buf_size >= 528
+ && (AV_RB64(b + 520) & 0xFFFFFFFFFFFF) == 0x001102ff0c00
+ && AV_RB16(b + 520)
+ && AV_RB16(b + 518))
+ return AVPROBE_SCORE_MAX * 3 / 4;
+ if ( (AV_RB64(b + 8) & 0xFFFFFFFFFFFF) == 0x001102ff0c00
+ && AV_RB16(b + 8)
+ && AV_RB16(b + 6))
+ return AVPROBE_SCORE_EXTENSION / 4;
return 0;
}
More information about the ffmpeg-cvslog
mailing list