diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-11 04:02:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-11 04:02:53 +0200 |
commit | c69defd4d014e27cbcf207fe6facaebb02ba1285 (patch) | |
tree | fa5ac69732bdd3c91da05431897742347b027da5 /libavcodec/qtrleenc.c | |
parent | 43d995e865f77adef1573b158452982a56814908 (diff) | |
download | ffmpeg-c69defd4d014e27cbcf207fe6facaebb02ba1285.tar.gz |
avcodec/qtrleenc: Check that width is a multiple of 4 for grayscale
grayscale is coded as 4 pixels at a time, the encoder lacks support
for the case where width%4 != 0, and will simply encode less data
leaving random data after decoding at the right side
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/qtrleenc.c')
-rw-r--r-- | libavcodec/qtrleenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c index 8750e3097a..d723188413 100644 --- a/libavcodec/qtrleenc.c +++ b/libavcodec/qtrleenc.c @@ -86,6 +86,10 @@ static av_cold int qtrle_encode_init(AVCodecContext *avctx) switch (avctx->pix_fmt) { case AV_PIX_FMT_GRAY8: + if (avctx->width % 4) { + av_log(avctx, AV_LOG_ERROR, "Width not being a multiple of 4 is not supported\n"); + return AVERROR(EINVAL); + } s->logical_width = avctx->width / 4; s->pixel_size = 4; break; |