Hi!
Attached patch fixes ticket #1304: biSizeImage may be 0 for images with codec
tag 0, if the size is set too small, WMP refuses to play the file.
Please comment, Carl Eugen
diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
index 2eb2ae1..9e30f64 100644
--- a/libavformat/riffenc.c
+++ b/libavformat/riffenc.c
@@ -224,7 +224,11 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext
*enc,
avio_wl16(pb, enc->bits_per_coded_sample ? enc->bits_per_coded_sample :
24);
/* compression type */
avio_wl32(pb, enc->codec_tag);
+ if (!enc->codec_tag) {
+ avio_wl32(pb, 0);
+ } else {
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);
_______________________________________________
ffmpeg-devel mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel