[FFmpeg-devel] [PATCH] vp9: fix memory corruption if header decoding fails after size change.

Ronald S. Bultje rsbultje at gmail.com
Sat Jan 25 01:22:45 CET 2014


---
 libavcodec/vp9.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index ec6ceb0..2965394 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);
     }
 
-- 
1.8.4



More information about the ffmpeg-devel mailing list