From 4147b337c10588b36a537c15c4b0b2b432fcc3ea Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Fri, 24 Jan 2014 19:21:57 -0500 Subject: [PATCH] vp9: fix memory corruption if header decoding fails after size change. --- libavcodec/vp9.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index ec6ceb010d..29653949d5 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -3772,7 +3772,8 @@ static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo VP9Context *s = dst->priv_data, *ssrc = src->priv_data; // detect size changes in other threads - if (s->above_partition_ctx && (s->cols != ssrc->cols || s->rows != ssrc->rows)) { + if (s->above_partition_ctx && + (!ssrc->above_partition_ctx || s->cols != ssrc->cols || s->rows != ssrc->rows)) { free_buffers(s); }