summaryrefslogtreecommitdiff
path: root/libavcodec/decode.c
diff options
context:
space:
mode:
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);