[Libva] [PATCH V1][libva-intel-driver] Return if the surface bo is NULL
Xiang, Haihao
haihao.xiang at intel.com
Fri Dec 30 08:26:25 UTC 2016
On Fri, 2016-12-30 at 16:18 +0800, Zhao Yakui wrote:
> On 12/30/2016 04:08 PM, peng.chen wrote:
> > Signed-off-by: peng.chen<peng.c.chen at intel.com>
>
> In fact the dri_bo_unreference function can handle the scenario that
> bo
> is NULL.
Yes, it is like as free() with NULL pointer.
>
> Of course it also looks good to me that the explicit check is added
> in
> the i965_destroy_surface_storage.
I think the original code is clean and prefer the original code.
>
> Add: Reviewed-by: Zhao Yakui <yakui.zhao at intel.com>
>
> Thanks
> > ---
> > src/i965_drv_video.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
> > index bf59374..ded3d93 100644
> > --- a/src/i965_drv_video.c
> > +++ b/src/i965_drv_video.c
> > @@ -1210,7 +1210,7 @@ VAStatus
> > i965_QueryConfigAttributes(VADriverContextP ctx,
> > void
> > i965_destroy_surface_storage(struct object_surface *obj_surface)
> > {
> > - if (!obj_surface)
> > + if (!obj_surface || !obj_surface->bo)
> > return;
> >
> > dri_bo_unreference(obj_surface->bo);
>
> _______________________________________________
> Libva mailing list
> Libva at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libva
More information about the Libva
mailing list