Commit 71175472 authored by Christophe Gisquet's avatar Christophe Gisquet Committed by Michael Niedermayer

hevc: fix incorrect sao buffer size

It previously used the output, cropped size, causing overreads/writes.

Fixes ticket #3839.

This issue was introduced by d249e682, which is not part of any release
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6985ef78
...@@ -280,16 +280,16 @@ static int get_buffer_sao(HEVCContext *s, AVFrame *frame, const HEVCSPS *sps) ...@@ -280,16 +280,16 @@ static int get_buffer_sao(HEVCContext *s, AVFrame *frame, const HEVCSPS *sps)
{ {
int ret, i; int ret, i;
frame->width = s->avctx->width + 2; frame->width = s->avctx->coded_width + 2;
frame->height = s->avctx->height + 2; frame->height = s->avctx->coded_height + 2;
if ((ret = ff_get_buffer(s->avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) if ((ret = ff_get_buffer(s->avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
return ret; return ret;
for (i = 0; frame->data[i]; i++) { for (i = 0; frame->data[i]; i++) {
int offset = frame->linesize[i] + (1 << sps->pixel_shift); int offset = frame->linesize[i] + (1 << sps->pixel_shift);
frame->data[i] += offset; frame->data[i] += offset;
} }
frame->width = s->avctx->width; frame->width = s->avctx->coded_width;
frame->height = s->avctx->height; frame->height = s->avctx->coded_height;
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment