On 10/25/2024 5:17 AM, Anton Khirnov wrote:
Quoting James Almer (2024-10-25 04:26:12)
And ensure the buffer is synced between threads.

Signed-off-by: James Almer <jamr...@gmail.com>
---
  libavcodec/h264_picture.c | 2 +-
  libavcodec/h264_slice.c   | 2 ++
  libavcodec/h264dec.c      | 2 +-
  3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c
index 371a794ec2..d07c3a0af8 100644
--- a/libavcodec/h264_picture.c
+++ b/libavcodec/h264_picture.c
@@ -215,7 +215,7 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, 
int in_setup)
          err = AVERROR_INVALIDDATA;
          if (sd) { // a decoding error may have happened before the side data 
could be allocated
              if (!h->h274db) {
-                h->h274db = av_mallocz(sizeof(*h->h274db));
+                h->h274db = ff_refstruct_allocz(sizeof(*h->h274db));

Doesn't this happen after ff_thread_finish_setup()?

I have no idea. Currently, h274db is not being synced between threads, but i think that was also the case before 08b1bffa4971, so maybe this patch can be dropped.

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to