1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-07-11 14:30:22 +02:00

avformat/img2dec: improve bmp probe

fix probetest failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-07-04 04:54:52 +02:00
parent d36fe733c1
commit c277ab6b78

View File

@ -564,8 +564,15 @@ 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)
return 0;
ihsize = AV_RL32(b+14);
if (ihsize < 12 || ihsize > 255)
return 0;
if (AV_RB16(b) == 0x424d)
if (!AV_RN32(b + 6)) { if (!AV_RN32(b + 6)) {
return AVPROBE_SCORE_EXTENSION + 1; return AVPROBE_SCORE_EXTENSION + 1;
} else { } else {