From 19e097c30c9874587a8c2a1edb45fba2f44b6f03 Mon Sep 17 00:00:00 2001 From: ChenHengming Date: Wed, 23 Sep 2015 22:54:57 +0000 Subject: [PATCH] [mpp_frame]: add name check to MppFrame git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@291 6e48237b-75ef-9749-8fc9-41990f28c85a --- mpp/mpp_frame.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mpp/mpp_frame.cpp b/mpp/mpp_frame.cpp index a41238ff..87d3472a 100644 --- a/mpp/mpp_frame.cpp +++ b/mpp/mpp_frame.cpp @@ -32,6 +32,8 @@ static void setup_mpp_frame_name(MppFrameImpl *frame) static void check_mpp_frame_name(MppFrameImpl *frame) { mpp_assert(frame->name == module_name); + if (frame->name != module_name) + abort(); } MPP_RET mpp_frame_init(MppFrame *frame) @@ -47,6 +49,7 @@ MPP_RET mpp_frame_init(MppFrame *frame) return MPP_ERR_NULL_PTR; } + setup_mpp_frame_name(p); *frame = p; return MPP_OK; @@ -59,6 +62,7 @@ MPP_RET mpp_frame_deinit(MppFrame *frame) return MPP_ERR_NULL_PTR; } + check_mpp_frame_name((MppFrameImpl *)*frame); MppBuffer buffer = mpp_frame_get_buffer(*frame); if (buffer) mpp_buffer_put(buffer); @@ -75,6 +79,7 @@ MppFrame mpp_frame_get_next(MppFrame frame) } MppFrameImpl *p = (MppFrameImpl *)frame; + check_mpp_frame_name(p); return (MppFrame)p->next; } @@ -86,6 +91,7 @@ MPP_RET mpp_frame_set_next(MppFrame frame, MppFrame next) } MppFrameImpl *p = (MppFrameImpl *)frame; + check_mpp_frame_name(p); p->next = (MppFrameImpl *)next; return MPP_OK; } @@ -97,6 +103,7 @@ MPP_RET mpp_frame_copy(MppFrame dst, MppFrame src) return MPP_ERR_NULL_PTR; } + check_mpp_frame_name((MppFrameImpl *)dst); memcpy(dst, src, sizeof(MppFrameImpl)); return MPP_OK; }