From e4555698dd0431d936d7cab461cad40bb3c51bbf Mon Sep 17 00:00:00 2001
From: Martin Vignali <martin.vignali@gmail.com>
Date: Sat, 17 Nov 2018 23:47:59 +0100
Subject: [PATCH 11/13] avcodec/proresdec : align height buffer to 16 (avoid 
 segfault)

---
 libavcodec/proresdec2.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index 8a537eed1a..f819f8db21 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -750,6 +750,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     buf += frame_hdr_size;
     buf_size -= frame_hdr_size;
 
+    /* align height to 16, to avoid segfault */
+    tframe.f->height = FFALIGN(avctx->height, 16);
+    tframe.f->width = FFALIGN(avctx->width, 16);
+    tframe.f->crop_bottom = tframe.f->height - avctx->height;
+
     if ((ret = ff_thread_get_buffer(avctx, &tframe, 0)) < 0)
         return ret;
 
-- 
2.14.3 (Apple Git-98)

