h264: initialize H264Context.avctx in init_thread_copy
authorAnton Khirnov <anton@khirnov.net>
Thu, 12 Feb 2015 12:06:49 +0000 (13:06 +0100)
committerAnton Khirnov <anton@khirnov.net>
Sat, 21 Feb 2015 08:35:17 +0000 (09:35 +0100)
This prevents using a wrong (first thread's) AVCodecContext if decoding
a frame in the first pass over all threads fails.

(cherry picked from commit a06b0b1295c51d100101e0ca0434e199ad6de6b5)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/h264.c

index 6dca22b..e9236e9 100644 (file)
@@ -686,6 +686,7 @@ static int decode_init_thread_copy(AVCodecContext *avctx)
     memset(h->sps_buffers, 0, sizeof(h->sps_buffers));
     memset(h->pps_buffers, 0, sizeof(h->pps_buffers));
 
+    h->avctx               = avctx;
     h->rbsp_buffer[0]      = NULL;
     h->rbsp_buffer[1]      = NULL;
     h->rbsp_buffer_size[0] = 0;