summaryrefslogtreecommitdiff
path: root/libavcodec/decode.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-11-27 10:50:47 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-03 16:07:02 +0100
commita4798a5d5109cd9c1b5682efe19660e825da97e6 (patch)
treec91e38e738cf12d468e06aaba77738173eed75e1 /libavcodec/decode.c
parentb574fb472ed168f5a75cd981c98dd34cfe57ff3a (diff)
downloadffmpeg-a4798a5d5109cd9c1b5682efe19660e825da97e6.tar.gz
all: Use av_memdup() where appropriate
Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r--libavcodec/decode.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index c44724d150..52bf5dcd33 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1104,12 +1104,10 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
avctx->sw_pix_fmt = fmt[n - 1];
}
- choices = av_malloc_array(n + 1, sizeof(*choices));
+ choices = av_memdup(fmt, (n + 1) * sizeof(*choices));
if (!choices)
return AV_PIX_FMT_NONE;
- memcpy(choices, fmt, (n + 1) * sizeof(*choices));
-
for (;;) {
// Remove the previous hwaccel, if there was one.
hwaccel_uninit(avctx);