mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-14 21:06:58 +08:00
all: Use av_memdup() where appropriate
Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user