summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_parser.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2017-05-24 11:46:07 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2017-05-25 10:29:07 -0400
commitca2209d67af0a73fe0edb2fce1cea2445dbfd8db (patch)
tree8195440acc607e5ae37d62f456c13b27e2299af6 /libavcodec/hevc_parser.c
parent4dc3714c48e74e75a3a9c7d9fb52fd5917107508 (diff)
downloadffmpeg-ca2209d67af0a73fe0edb2fce1cea2445dbfd8db.tar.gz
hevc: fix race condition in max_ra/seq_decode.
These variables are shared between frame threads, but they are updated post-setup_finished() if a EOB/EOS slice type occurs. Moving the EOB/EOS slices to the next frame thread instance (by parsing them leading into the next picture instead of trailing behind the last picture) effectively prevents this race condition. This fixes tsan failures on hevc-conformance-NoOutPrior_A_Qualcomm_1.
Diffstat (limited to 'libavcodec/hevc_parser.c')
-rw-r--r--libavcodec/hevc_parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index c72b1465f1..2b58eb62fe 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -267,7 +267,7 @@ static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf,
nut = (pc->state64 >> 2 * 8 + 1) & 0x3F;
// Beginning of access unit
- if ((nut >= HEVC_NAL_VPS && nut <= HEVC_NAL_AUD) || nut == HEVC_NAL_SEI_PREFIX ||
+ if ((nut >= HEVC_NAL_VPS && nut <= HEVC_NAL_EOB_NUT) || nut == HEVC_NAL_SEI_PREFIX ||
(nut >= 41 && nut <= 44) || (nut >= 48 && nut <= 55)) {
if (pc->frame_start_found) {
pc->frame_start_found = 0;