X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Friff.c;h=74f384d26848f997c1ea4ad67dc2d40d74598c1f;hb=f37174bc1913d534913e8825f1609a637cc4b364;hp=6c8d8abe402c0b5f96f8c2b93e00f505f87766b2;hpb=1fa8ff38e47b3e0fc63e2a2e8fbbcf9e4fb071c5;p=ffmpeg diff --git a/libavformat/riff.c b/libavformat/riff.c index 6c8d8abe402..74f384d2684 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -174,6 +174,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { { CODEC_ID_RAWVIDEO, MKTAG('2', 'V', 'u', '1') }, { CODEC_ID_RAWVIDEO, MKTAG('2', 'v', 'u', 'y') }, { CODEC_ID_RAWVIDEO, MKTAG('y', 'u', 'v', 's') }, + { CODEC_ID_RAWVIDEO, MKTAG('y', 'u', 'v', '2') }, { CODEC_ID_RAWVIDEO, MKTAG('P', '4', '2', '2') }, { CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', '1', '2') }, { CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', '1', '6') }, @@ -198,6 +199,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { { CODEC_ID_R10K, MKTAG('R', '1', '0', 'k') }, { CODEC_ID_R210, MKTAG('r', '2', '1', '0') }, { CODEC_ID_V210, MKTAG('v', '2', '1', '0') }, + { CODEC_ID_V410, MKTAG('v', '4', '1', '0') }, { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') }, { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '2') }, { CODEC_ID_INDEO4, MKTAG('I', 'V', '4', '1') }, @@ -266,7 +268,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { { CODEC_ID_TARGA, MKTAG('t', 'g', 'a', ' ') }, { CODEC_ID_PNG, MKTAG('M', 'P', 'N', 'G') }, { CODEC_ID_PNG, MKTAG('P', 'N', 'G', '1') }, - { CODEC_ID_CLJR, MKTAG('c', 'l', 'j', 'r') }, + { CODEC_ID_CLJR, MKTAG('C', 'L', 'J', 'R') }, { CODEC_ID_DIRAC, MKTAG('d', 'r', 'a', 'c') }, { CODEC_ID_RPZA, MKTAG('a', 'z', 'p', 'r') }, { CODEC_ID_RPZA, MKTAG('R', 'P', 'Z', 'A') }, @@ -286,6 +288,9 @@ const AVCodecTag ff_codec_bmp_tags[] = { { CODEC_ID_UTVIDEO, MKTAG('U', 'L', 'Y', '0') }, { CODEC_ID_UTVIDEO, MKTAG('U', 'L', 'Y', '2') }, { CODEC_ID_VBLE, MKTAG('V', 'B', 'L', 'E') }, + { CODEC_ID_ESCAPE130, MKTAG('E', '1', '3', '0') }, + { CODEC_ID_DXTORY, MKTAG('x', 't', 'o', 'r') }, + { CODEC_ID_Y41P, MKTAG('Y', '4', '1', 'P') }, { CODEC_ID_NONE, 0 } }; @@ -515,7 +520,7 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *t avio_wl16(pb, enc->bits_per_coded_sample ? enc->bits_per_coded_sample : 24); /* depth */ /* compression type */ avio_wl32(pb, enc->codec_tag); - avio_wl32(pb, enc->width * enc->height * 3); + avio_wl32(pb, (enc->width * enc->height * (enc->bits_per_coded_sample ? enc->bits_per_coded_sample : 24)+7) / 8); avio_wl32(pb, 0); avio_wl32(pb, 0); avio_wl32(pb, 0); @@ -711,8 +716,7 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size) AV_WL32(key, chunk_code); if (avio_read(pb, value, chunk_size) != chunk_size) { - av_freep(key); - av_freep(value); + av_freep(&value); av_log(s, AV_LOG_ERROR, "premature end of file while reading INFO tag\n"); return AVERROR_INVALIDDATA; }