diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-09-07 00:09:10 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-09-12 09:42:27 +0200 |
commit | 423b6a7e493828dd91d5e590e0905236f1f46557 (patch) | |
tree | 2bdbe0020ba7ecab45e3f0909a7f3d862520a6c7 /libavcodec/amfenc.c | |
parent | 5094d1f429e58a67c542f1c5940a3de5184c35ca (diff) | |
download | ffmpeg-423b6a7e493828dd91d5e590e0905236f1f46557.tar.gz |
avutil/imgutils: Add wrapper for av_image_copy() to avoid casts
av_image_copy() accepts const uint8_t* const * as source;
lots of user have uint8_t* const * and therefore either
cast (the majority) or copy the array of pointers.
This commit changes this by adding a static inline wrapper
for av_image_copy() that casts between the two types
so that we do not need to add casts everywhere else.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/amfenc.c')
-rw-r--r-- | libavcodec/amfenc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c index 518b8396e7..061859f85c 100644 --- a/libavcodec/amfenc.c +++ b/libavcodec/amfenc.c @@ -430,9 +430,9 @@ static int amf_copy_surface(AVCodecContext *avctx, const AVFrame *frame, dst_data[i] = plane->pVtbl->GetNative(plane); dst_linesize[i] = plane->pVtbl->GetHPitch(plane); } - av_image_copy(dst_data, dst_linesize, - (const uint8_t**)frame->data, frame->linesize, frame->format, - avctx->width, avctx->height); + av_image_copy2(dst_data, dst_linesize, + frame->data, frame->linesize, frame->format, + avctx->width, avctx->height); return 0; } |