summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-03-05 20:35:09 +0100
committerJan Ekström <jeebjp@gmail.com>2023-03-05 22:36:56 +0200
commit22e326465251a8324c138b0570217dd68ec57184 (patch)
tree506b1319fc89027307d21a70d43168bdb05d78ca /video
parent2a7122ac41c939fea05a361a3838ca2773de4379 (diff)
downloadmpv-22e326465251a8324c138b0570217dd68ec57184.tar.bz2
mpv-22e326465251a8324c138b0570217dd68ec57184.tar.xz
mp_image: assert if src and dst are different in copy_attributes
It doesn't make sense to call this function on same image and the code is not safe to do so.
Diffstat (limited to 'video')
-rw-r--r--video/mp_image.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index 7d92d3c567..c061cb6a16 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -516,6 +516,8 @@ static void assign_bufref(AVBufferRef **dst, AVBufferRef *new)
void mp_image_copy_attributes(struct mp_image *dst, struct mp_image *src)
{
+ assert(dst != src);
+
dst->pict_type = src->pict_type;
dst->fields = src->fields;
dst->pts = src->pts;