mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 18:40:03 +01:00
mpegvideo: increase buffer sizes.
Fixes buffer overflow
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2c0559d5e2)
This commit is contained in:
@@ -422,12 +422,12 @@ static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base)
|
|||||||
// edge emu needs blocksize + filter length - 1
|
// edge emu needs blocksize + filter length - 1
|
||||||
// (= 17x17 for halfpel / 21x21 for h264)
|
// (= 17x17 for halfpel / 21x21 for h264)
|
||||||
FF_ALLOCZ_OR_GOTO(s->avctx, s->edge_emu_buffer,
|
FF_ALLOCZ_OR_GOTO(s->avctx, s->edge_emu_buffer,
|
||||||
(s->width + 64) * 2 * 21 * 2, fail); // (width + edge + align)*interlaced*MBsize*tolerance
|
(s->width + 95) * 2 * 21 * 4, fail); // (width + edge + align)*interlaced*MBsize*tolerance
|
||||||
|
|
||||||
// FIXME should be linesize instead of s->width * 2
|
// FIXME should be linesize instead of s->width * 2
|
||||||
// but that is not known before get_buffer()
|
// but that is not known before get_buffer()
|
||||||
FF_ALLOCZ_OR_GOTO(s->avctx, s->me.scratchpad,
|
FF_ALLOCZ_OR_GOTO(s->avctx, s->me.scratchpad,
|
||||||
(s->width + 64) * 4 * 16 * 2 * sizeof(uint8_t), fail)
|
(s->width + 95) * 4 * 16 * 2 * sizeof(uint8_t), fail)
|
||||||
s->me.temp = s->me.scratchpad;
|
s->me.temp = s->me.scratchpad;
|
||||||
s->rd_scratchpad = s->me.scratchpad;
|
s->rd_scratchpad = s->me.scratchpad;
|
||||||
s->b_scratchpad = s->me.scratchpad;
|
s->b_scratchpad = s->me.scratchpad;
|
||||||
|
|||||||
Reference in New Issue
Block a user