diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 6d14a878a442db0c6447efae31f5167b0c9617b3..a72391ba3674942a57424d5361e933e80bdc9738 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -229,6 +229,7 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
         dst->width     = src->width;
         dst->height    = src->height;
         dst->pix_fmt   = src->pix_fmt;
+        dst->sw_pix_fmt = src->sw_pix_fmt;
 
         dst->coded_width  = src->coded_width;
         dst->coded_height = src->coded_height;