Explain why avifImageCopy() disallows self copy
diff --git a/src/avif.c b/src/avif.c index 0da12c2..76185db 100644 --- a/src/avif.c +++ b/src/avif.c
@@ -250,6 +250,8 @@ avifResult avifImageCopy(avifImage * dstImage, const avifImage * srcImage, avifPlanesFlags planes) { + // Disallow self copy even though it could be supported easily. Self copy is + // unlikely to be needed, so it almost always indicates a programming error. AVIF_CHECKERR(dstImage != srcImage, AVIF_RESULT_INVALID_ARGUMENT); avifImageFreePlanes(dstImage, AVIF_PLANES_ALL); avifImageCopyNoAlloc(dstImage, srcImage);