You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
This commit is contained in:
@@ -148,7 +148,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
ptr = p->data[0];
|
ptr = p->data[0];
|
||||||
stride = p->linesize[0];
|
stride = p->linesize[0];
|
||||||
|
|
||||||
scanline = av_malloc(bytes_per_scanline);
|
scanline = av_malloc(bytes_per_scanline + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if (!scanline)
|
if (!scanline)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user