[vlc-commits] va_surface: clean the access to the picture_sys_t

Steve Lhomme git at videolan.org
Thu Jun 20 10:03:22 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jun 20 09:47:34 2019 +0200| [9ca92cfb1a0defe48cfa429e3dc64a9383f67ea3] | committer: Steve Lhomme

va_surface: clean the access to the picture_sys_t

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ca92cfb1a0defe48cfa429e3dc64a9383f67ea3
---

 modules/codec/avcodec/va_surface.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/va_surface.h b/modules/codec/avcodec/va_surface.h
index 8d15efdbb5..8ae67077ae 100644
--- a/modules/codec/avcodec/va_surface.h
+++ b/modules/codec/avcodec/va_surface.h
@@ -38,8 +38,8 @@ struct va_pic_context
 
 static inline VA_PICSYS *ActivePictureSys(picture_t *p_pic)
 {
-    struct va_pic_context *pic_ctx = (struct va_pic_context*)p_pic->context;
-    return pic_ctx ? &pic_ctx->picsys : p_pic->p_sys;
+    struct va_pic_context *pic_ctx = container_of(p_pic->context, struct va_pic_context, s);
+    return p_pic->context ? &pic_ctx->picsys : p_pic->p_sys;
 }
 
 #endif /* AVCODEC_VA_SURFACE_H */



More information about the vlc-commits mailing list