Commit c277ab6b authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/img2dec: improve bmp probe

fix probetest failure
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d36fe733
...@@ -564,13 +564,20 @@ AVInputFormat ff_image2pipe_demuxer = { ...@@ -564,13 +564,20 @@ AVInputFormat ff_image2pipe_demuxer = {
static int bmp_probe(AVProbeData *p) static int bmp_probe(AVProbeData *p)
{ {
const uint8_t *b = p->buf; const uint8_t *b = p->buf;
int ihsize;
if (AV_RB16(b) == 0x424d) if (AV_RB16(b) != 0x424d)
if (!AV_RN32(b + 6)) { return 0;
return AVPROBE_SCORE_EXTENSION + 1;
} else { ihsize = AV_RL32(b+14);
return AVPROBE_SCORE_EXTENSION / 4; if (ihsize < 12 || ihsize > 255)
} return 0;
if (!AV_RN32(b + 6)) {
return AVPROBE_SCORE_EXTENSION + 1;
} else {
return AVPROBE_SCORE_EXTENSION / 4;
}
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment