[FFmpeg-devel] [PATCH 1/2] avutil/common: Add FF_PTR_ADD()

Michael Niedermayer michael at niedermayer.cc
Mon Mar 15 10:47:43 EET 2021


Suggested-by: Andreas Rheinhardt
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavutil/common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/common.h b/libavutil/common.h
index aee353d399..c2d47a45b4 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -108,6 +108,8 @@
 #define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
 #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
 
+#define FF_PTR_ADD(ptr, off) ((off) ? (ptr) + (off) : (ptr))
+
 /* misc math functions */
 
 #ifdef HAVE_AV_CONFIG_H
-- 
2.17.1



More information about the ffmpeg-devel mailing list