h264: don't write to source picture object in ff_h264_ref_picture().
authorRonald S. Bultje <rsbultje@gmail.com>
Wed, 29 Mar 2017 13:03:49 +0000 (09:03 -0400)
committerRonald S. Bultje <rsbultje@gmail.com>
Fri, 31 Mar 2017 12:26:24 +0000 (08:26 -0400)
Doing so is analogous to writing to source data in memcpy(), and causes
(harmless) tsan warnings in fate-h264.

libavcodec/h264_picture.c

index f634d2a..db96737 100644 (file)
@@ -70,8 +70,8 @@ int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src)
 
     av_assert0(!dst->f->buf[0]);
     av_assert0(src->f->buf[0]);
+    av_assert0(src->tf.f == src->f);
 
-    src->tf.f = src->f;
     dst->tf.f = dst->f;
     ret = ff_thread_ref_frame(&dst->tf, &src->tf);
     if (ret < 0)