Commit bd737b51 authored by Anton Khirnov's avatar Anton Khirnov

h264: reset the private data in init_thread_copy()

The generic code copies the main context's private data to all the
others. However that is quite dangerous, as it might end up copying some
pointers that are or will become invalid.

Since everything we actually need will be copied later in
update_thread_context(), it's safest to zero the private data in
init_thread_copy(), so it works the same way as init for the main
context.
parent a939e5b2
......@@ -677,8 +677,8 @@ static int decode_init_thread_copy(AVCodecContext *avctx)
if (!avctx->internal->is_copy)
return 0;
memset(h->sps_buffers, 0, sizeof(h->sps_buffers));
memset(h->pps_buffers, 0, sizeof(h->pps_buffers));
memset(h, 0, sizeof(*h));
ret = h264_init_context(avctx, h);
if (ret < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment