diff mbox

[FFmpeg-devel,3/3] lavfi: add a framework to fix alignment problems.

Message ID 20170506092006.22397-3-george@nsup.org
State Superseded
Headers show

Commit Message

Nicolas George May 6, 2017, 9:20 a.m. UTC
A lot of filters require aligned frame data, but do not document it.
It can result in crashes with perfectly valid uses of the API.

Signed-off-by: Nicolas George <george@nsup.org>
---
 libavfilter/avfilter.h | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox

Patch

diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 60662c19ac..db9c02b8c0 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -569,6 +569,15 @@  struct AVFilterLink {
      */
     AVBufferRef *hw_frames_ctx;
 
+    /**
+     * Minimum alignment of frame data required by the destination filter.
+     * All frame data pointers must have the alignment lower bits cleared,
+     * i.e. be a multiple of 1<<alignment.
+     * Frames with insufficient alignment will be realigned by the
+     * framework.
+     */
+    unsigned alignment;
+
 #ifndef FF_INTERNAL_FIELDS
 
     /**