1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Merge remote-tracking branch 'cehoyos/master'

* cehoyos/master:
  Use os/2 palette even if it contains less than 256 entries.
  Assume that old bmps do not contain transparency information.
  Do not detect jp2 images as mov files.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-07-05 04:12:08 +02:00
commit d5818c37f3
2 changed files with 6 additions and 1 deletions

View File

@ -128,6 +128,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
rgb[0] = bytestream_get_le32(&buf);
rgb[1] = bytestream_get_le32(&buf);
rgb[2] = bytestream_get_le32(&buf);
if (ihsize > 40)
alpha = bytestream_get_le32(&buf);
}
@ -247,6 +248,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
} else if (t) {
colors = t;
}
} else {
colors = FFMIN(256, (hsize-ihsize-14) / 3);
}
buf = buf0 + 14 + ihsize; //palette location
// OS/2 bitmap, 3 bytes per palette entry

View File

@ -3264,7 +3264,6 @@ static int mov_probe(AVProbeData *p)
/* check for obvious tags */
case MKTAG('m','o','o','v'):
moov_offset = offset + 4;
case MKTAG('j','P',' ',' '): /* jpeg 2000 signature */
case MKTAG('m','d','a','t'):
case MKTAG('p','n','o','t'): /* detect movs with preview pics like ew.mov and april.mov */
case MKTAG('u','d','t','a'): /* Packet Video PVAuthor adds this and a lot of more junk */
@ -3274,6 +3273,9 @@ static int mov_probe(AVProbeData *p)
offset + 12 > (unsigned int)p->buf_size ||
AV_RB64(p->buf+offset + 8) == 0)) {
score = FFMAX(score, AVPROBE_SCORE_EXTENSION);
} else if (tag == MKTAG('f','t','y','p') &&
AV_RL32(p->buf + offset + 8) == MKTAG('j','p','2',' ')) {
score = FFMAX(score, 5);
} else {
score = AVPROBE_SCORE_MAX;
}