[FFmpeg-cvslog] avutil/common: Add FF_PTR_ADD()

Michael Niedermayer git at videolan.org
Thu Apr 1 12:49:51 EEST 2021


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Mon Mar 15 09:47:43 2021 +0100| [18bcfa81fc15a3cfdcadf52bdbeb8ce23d2f913a] | committer: Michael Niedermayer

avutil/common: Add FF_PTR_ADD()

Suggested-by: Andreas Rheinhardt
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 522a5259e9cc17faf1f83c9cfb93c960a2ecf8a2)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=18bcfa81fc15a3cfdcadf52bdbeb8ce23d2f913a
---

 libavutil/internal.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/internal.h b/libavutil/internal.h
index 572daefec3..2ed1c2abb1 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -102,6 +102,8 @@
 #define FF_ALLOC_TYPED_ARRAY(p, nelem)  (p = av_malloc_array(nelem, sizeof(*p)))
 #define FF_ALLOCZ_TYPED_ARRAY(p, nelem) (p = av_mallocz_array(nelem, sizeof(*p)))
 
+#define FF_PTR_ADD(ptr, off) ((off) ? (ptr) + (off) : (ptr))
+
 #include "libm.h"
 
 /**



More information about the ffmpeg-cvslog mailing list