From e059ac59efb8001494870af5c6ac72d900846b0b Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 26 Jun 2014 20:44:21 +0200 Subject: avcodec/snow: ensure the buffers have allocated edges Signed-off-by: Michael Niedermayer --- libavcodec/snow.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libavcodec/snow.c') diff --git a/libavcodec/snow.c b/libavcodec/snow.c index bd20388847..616d1170af 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -661,9 +661,18 @@ int ff_snow_frame_start(SnowContext *s){ return -1; } } - + s->current_picture->width = s->avctx->width + 2 * EDGE_WIDTH; + s->current_picture->height = s->avctx->height + 2 * EDGE_WIDTH; if ((ret = ff_get_buffer(s->avctx, s->current_picture, AV_GET_BUFFER_FLAG_REF)) < 0) return ret; + for (i = 0; s->current_picture->data[i]; i++) { + int offset = (EDGE_WIDTH >> (i ? s->chroma_v_shift : 0)) * + s->current_picture->linesize[i] + + (EDGE_WIDTH >> (i ? s->chroma_h_shift : 0)); + s->current_picture->data[i] += offset; + } + s->current_picture->width = s->avctx->width; + s->current_picture->height = s->avctx->height; s->current_picture->key_frame= s->keyframe; -- cgit v1.2.3