aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-07-16 18:21:29 +0200
committerAnton Khirnov <anton@khirnov.net>2024-08-12 14:42:20 +0200
commit8d5efc218245c3f0559f48837b3e63e2932525e0 (patch)
tree389870faa9202f4c4b8f15cc6b808634142fd85b /libavcodec/ffv1.c
parent15bdca054f562b19811e1bbe295db542e0aca616 (diff)
downloadffmpeg-8d5efc218245c3f0559f48837b3e63e2932525e0.tar.gz
lavc/ffv1dec: fix races in accessing FFV1SliceContext.slice_damaged
That variable is shared between frame threads in the same defective way described in the previous commit. Fix it by adding a RefStruct-managed arrays of flags that is propagated across frame threads in the standard manner. Remove now-unused FFV1Context.fsrc
Diffstat (limited to 'libavcodec/ffv1.c')
-rw-r--r--libavcodec/ffv1.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 9c219b5ddb..333fb3d79b 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -214,6 +214,8 @@ av_cold int ff_ffv1_close(AVCodecContext *avctx)
ff_refstruct_unref(&sc->plane);
}
+ ff_refstruct_unref(&s->slice_damaged);
+
av_freep(&avctx->stats_out);
for (j = 0; j < s->quant_table_count; j++) {
av_freep(&s->initial_states[j]);