[FFmpeg-devel] [PATCH 31/92] Vulkan patchset part 1 - common code changes

Lynne dev at lynne.ee
Wed Apr 19 17:49:58 EEST 2023


Apr 17, 2023, 11:46 by anton at khirnov.net:

> Quoting Lynne (2023-03-14 07:33:43)
>
>> From e37330cf6a1f768c733ca6d0b23b9e5847a5fe4f Mon Sep 17 00:00:00 2001
>> From: Lynne <dev at lynne.ee>
>> Date: Thu, 10 Mar 2022 18:03:05 +0100
>> Subject: [PATCH 25/92] avcodec: add AVHWAccel.free_frame_priv callback
>> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
>> index d1ba7f167f..c4630ce275 100644
>> --- a/libavcodec/decode.c
>> +++ b/libavcodec/decode.c
>> @@ -1685,3 +1685,22 @@ int ff_copy_palette(void *dst, const AVPacket *src, void *logctx)
>>  }
>>  return 0;
>>  }
>> +
>> +AVBufferRef *ff_alloc_hwaccel_frame_priv_data(AVCodecContext *avctx,
>>
>
> Sane-endian naming please. ff_hwaccel_frame_priv_alloc().
>

Done


>> +                                              const AVHWAccel *hwaccel)
>> +{
>> +    AVBufferRef *ref;
>> +    uint8_t *data = av_mallocz(hwaccel->frame_priv_data_size);
>> +    if (!data)
>> +        return NULL;
>> +
>> +    ref = av_buffer_create(data, hwaccel->frame_priv_data_size,
>> +                           (void (*)(void *, uint8_t *))hwaccel->free_frame_priv,
>>
>
> I believe the cast is UB and you should convert the arguments in the
> function itself, or add a trivial wrapper here.
>

I converted the arguments of the function.


More information about the ffmpeg-devel mailing list