From 53b6503184a9403e9ac7eb77a35059be64a308b0 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 17 Dec 2011 03:25:46 +0100 Subject: [PATCH] avienc: Fix rawvideo 32bit Bug found by: Rik Maes Change based on suggestion by Rik Maes Signed-off-by: Michael Niedermayer --- libavformat/riff.c | 2 +- tests/ref/vsynth1/huffyuv | 2 +- tests/ref/vsynth1/yuv | 2 +- tests/ref/vsynth2/huffyuv | 2 +- tests/ref/vsynth2/yuv | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/riff.c b/libavformat/riff.c index ea598d272e..4f475ba04d 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -519,7 +519,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); diff --git a/tests/ref/vsynth1/huffyuv b/tests/ref/vsynth1/huffyuv index fefc84a3b4..9ec091eb36 100644 --- a/tests/ref/vsynth1/huffyuv +++ b/tests/ref/vsynth1/huffyuv @@ -1,4 +1,4 @@ -ace2536fa169d835d0fb332abde28d51 *./tests/data/vsynth1/huffyuv.avi +f5f2e109af0612694ff3cd6464063e82 *./tests/data/vsynth1/huffyuv.avi 7933800 ./tests/data/vsynth1/huffyuv.avi c5ccac874dbf808e9088bc3107860042 *./tests/data/huffyuv.vsynth1.out.yuv stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth1/yuv b/tests/ref/vsynth1/yuv index b98dda503a..6d8b1431db 100644 --- a/tests/ref/vsynth1/yuv +++ b/tests/ref/vsynth1/yuv @@ -1,4 +1,4 @@ -aa6b9e862aebcf8902a6d770e7729d59 *./tests/data/vsynth1/yuv.avi +eaa66c3b27a2602e882befe154a8b119 *./tests/data/vsynth1/yuv.avi 7610060 ./tests/data/vsynth1/yuv.avi c5ccac874dbf808e9088bc3107860042 *./tests/data/yuv.vsynth1.out.yuv stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth2/huffyuv b/tests/ref/vsynth2/huffyuv index 740862aba4..e59b53ca3e 100644 --- a/tests/ref/vsynth2/huffyuv +++ b/tests/ref/vsynth2/huffyuv @@ -1,4 +1,4 @@ -56cd44907a48990e06bd065e189ff461 *./tests/data/vsynth2/huffyuv.avi +ed66182be0d515e8b6cb970ad63162da *./tests/data/vsynth2/huffyuv.avi 6455232 ./tests/data/vsynth2/huffyuv.avi dde5895817ad9d219f79a52d0bdfb001 *./tests/data/huffyuv.vsynth2.out.yuv stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth2/yuv b/tests/ref/vsynth2/yuv index 6593ce9b3d..699ebc9b9f 100644 --- a/tests/ref/vsynth2/yuv +++ b/tests/ref/vsynth2/yuv @@ -1,4 +1,4 @@ -30a400773ab26f2c83e469198b156f1d *./tests/data/vsynth2/yuv.avi +3d5ee6d2023bc15bba898819e4977e46 *./tests/data/vsynth2/yuv.avi 7610060 ./tests/data/vsynth2/yuv.avi dde5895817ad9d219f79a52d0bdfb001 *./tests/data/yuv.vsynth2.out.yuv stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200 -- 2.11.0