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 /libavcodec | |
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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/r210enc.c | 4 |
1 files changed, 3 insertions, 1 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]; } |