[FFmpeg-devel] [PATCH] avutil/frame: ensure the frame is writable in av_frame_copy()
James Almer
jamrial at gmail.com
Wed Mar 10 19:13:08 EET 2021
Signed-off-by: James Almer <jamrial at gmail.com>
---
libavutil/frame.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavutil/frame.c b/libavutil/frame.c
index eab51b6a32..ec79d053e1 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -800,6 +800,8 @@ int av_frame_copy(AVFrame *dst, const AVFrame *src)
{
if (dst->format != src->format || dst->format < 0)
return AVERROR(EINVAL);
+ if (!av_frame_is_writable(dst))
+ return AVERROR(EINVAL);
if (dst->width > 0 && dst->height > 0)
return frame_copy_video(dst, src);
--
2.30.1
More information about the ffmpeg-devel
mailing list