diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-01-29 19:03:04 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-29 21:00:19 +0100 |
commit | 371946bc27bd1e874e0302699550ab9926249950 (patch) | |
tree | 8d4294e11723540e0b4f6d63be2f886e231f7da0 | |
parent | 3b93a524c2d7aad669b0f01ea5e1336e5a6258bf (diff) | |
download | ffmpeg-371946bc27bd1e874e0302699550ab9926249950.tar.gz |
r210enc: don't write uninitialized data
Also fix r210 fate decoding test.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/r210enc.c | 4 | ||||
-rwxr-xr-x | tests/codec-regression.sh | 4 | ||||
-rw-r--r-- | tests/ref/vsynth1/r210 | 4 | ||||
-rw-r--r-- | tests/ref/vsynth2/r210 | 4 |
4 files changed, 9 insertions, 7 deletions
diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c index 1d924cc77c..f5ba42da50 100644 --- a/libavcodec/r210enc.c +++ b/libavcodec/r210enc.c @@ -39,6 +39,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *buf, AVFrame *pic = data; int i, j; int aligned_width = FFALIGN(avctx->width, 64); + int pad = (aligned_width - avctx->width) * 4; uint8_t *src_line; uint8_t *dst = buf; @@ -68,7 +69,8 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *buf, else bytestream_put_be32(&dst, pixel); } - dst += (aligned_width - avctx->width) * 4; + memset(dst, 0, pad); + dst += pad; src_line += pic->linesize[0]; } diff --git a/tests/codec-regression.sh b/tests/codec-regression.sh index 41269ad0d0..5da37b9b9a 100755 --- a/tests/codec-regression.sh +++ b/tests/codec-regression.sh @@ -320,8 +320,8 @@ do_video_decoding "" "-pix_fmt yuv420p" fi if [ -n "$do_r210" ] ; then -do_video_encoding r210.avi "-an -c:v r210 -pix_fmt rgb48le" -do_video_decoding "" "-pix_fmt rgb48le" +do_video_encoding r210.avi "-an -c:v r210" +do_video_decoding "" "-pix_fmt yuv420p" fi if [ -n "$do_v210" ] ; then diff --git a/tests/ref/vsynth1/r210 b/tests/ref/vsynth1/r210 index 02babd083d..9d5e37c7ff 100644 --- a/tests/ref/vsynth1/r210 +++ b/tests/ref/vsynth1/r210 @@ -1,4 +1,4 @@ 604a34c9f9151891c2d63d2652b75329 *./tests/data/vsynth1/r210.avi 22125260 ./tests/data/vsynth1/r210.avi -1ac5ec3bbb6bfbdf1ce6316e48e5fd89 *./tests/data/r210.vsynth1.out.yuv -stddev: 91.79 PSNR: 8.87 MAXDIFF: 254 bytes: 30412800/ 7603200 +ecaafa9eec11b5e1453a63ed6d194eed *./tests/data/r210.vsynth1.out.yuv +stddev: 3.23 PSNR: 37.94 MAXDIFF: 48 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth2/r210 b/tests/ref/vsynth2/r210 index caec7b60eb..c7e1373e8b 100644 --- a/tests/ref/vsynth2/r210 +++ b/tests/ref/vsynth2/r210 @@ -1,4 +1,4 @@ d7a6f298e6869a74c0988fc3b30d0351 *./tests/data/vsynth2/r210.avi 22125260 ./tests/data/vsynth2/r210.avi -3ca229927a09e3d7ecedc0b868c568b0 *./tests/data/r210.vsynth2.out.yuv -stddev: 82.11 PSNR: 9.84 MAXDIFF: 230 bytes: 30412800/ 7603200 +6ea4fcd93fc83defc8770e85b64b60bb *./tests/data/r210.vsynth2.out.yuv +stddev: 0.70 PSNR: 51.12 MAXDIFF: 12 bytes: 7603200/ 7603200 |