Module: libav Branch: release/12 Commit: 6bf7ffab7967150c3189d20221dac864b35f06d0
Author: Anton Khirnov <an...@khirnov.net> Committer: Anton Khirnov <an...@khirnov.net> Date: Sun Aug 14 10:18:39 2016 +0200 pcx: properly pad the scanline It is passed to the get_bits API, which requires buffers to be padded. Fixes possible invalid reads. CC: libav-sta...@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind (cherry picked from commit 15ee419b7abaf17f8c662c145fe93d3dbf43282b) Signed-off-by: Anton Khirnov <an...@khirnov.net> --- libavcodec/pcx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index aa69d51..77b2331 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -148,7 +148,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ptr = p->data[0]; stride = p->linesize[0]; - scanline = av_malloc(bytes_per_scanline); + scanline = av_malloc(bytes_per_scanline + AV_INPUT_BUFFER_PADDING_SIZE); if (!scanline) return AVERROR(ENOMEM); _______________________________________________ libav-commits mailing list libav-commits@libav.org https://lists.libav.org/mailman/listinfo/libav-commits