summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1dec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-21 06:24:04 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-19 01:14:39 +0100
commit17605d1a4afa5761271b27b2aea756a772ca0efc (patch)
tree9f8321503e30ba2782c3218af3fe68c24e3859cd /libavcodec/ffv1dec.c
parentdfd06ee710b547e0027a38f63cabe868e9ef1a3c (diff)
avcodec/ffv1dec: Remove redundant writes, fix races
Every modification of the data that is copied in update_thread_context() is a data race if it happens after ff_thread_finish_setup. ffv1dec's update_thread_context() simply uses memcpy for updating the new context, so that every modification of the src's context is a race. Some of these modifications are unnecessary: picture_number is write-only for the decoder and cur will be reset when decoding the next frame anyway. So remove them. And while just at it, also don't set cur for the slice contexts as this variable is write-only. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r--libavcodec/ffv1dec.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 374546f4b3..74c907a156 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -924,7 +924,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
fs->c.bytestream_end = buf_p + v;
fs->avctx = avctx;
- fs->cur = p;
}
avctx->execute(avctx,
@@ -965,11 +964,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
}
ff_thread_report_progress(&f->picture, INT_MAX, 0);
- f->picture_number++;
-
if (f->last_picture.f)
ff_thread_release_buffer(avctx, &f->last_picture);
- f->cur = NULL;
if ((ret = av_frame_ref(data, f->picture.f)) < 0)
return ret;