Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1 from skibey/master
Browse files Browse the repository at this point in the history
Fix a memory corruption to prevent segfault in VP8
  • Loading branch information
seanvk committed Feb 19, 2014
2 parents c12372d + b25182a commit a14418a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/x11/psb_xvva.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,14 @@ static int GetPortId(VADriverContextP ctx, psb_x11_output_p output)
Display *dpy = (Display *)ctx->native_dpy;

ret = XvQueryAdaptors(dpy, DefaultRootWindow(dpy), &numAdapt, &info);
/*Force overlay port num equal to one. OverlayC can't be used independently now.*/
info[1].num_ports = 1;

/* check for numAdapt before modifying the info[1]. Without this check
* it will cause a memory corruption leading to segfaults */
if (numAdapt > 1)
{
/*Force overlay port num equal to one. OverlayC can't be used independently now.*/
info[1].num_ports = 1;
}

if (Success != ret) {
drv_debug_msg(VIDEO_DEBUG_ERROR, "Can't find Xvideo adaptor\n");
Expand Down

0 comments on commit a14418a

Please sign in to comment.