summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86xv.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-03-21 17:12:06 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-04-21 16:58:08 -0700
commit4cb1034906eeec8c8442d70918bea0f4eb1f6e44 (patch)
treec96b91e7ba6ae162a2e652b0d1aff7495ec6af10 /hw/xfree86/common/xf86xv.c
parentf59236c2865d22c6f0b2d1ba303213afd10cd02e (diff)
Convert hw/xfree86 to new *allocarray functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'hw/xfree86/common/xf86xv.c')
-rw-r--r--hw/xfree86/common/xf86xv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index b974cd212..d613d712c 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -131,8 +131,8 @@ xf86XVRegisterGenericAdaptorDriver(xf86XVInitGenericAdaptorPtr InitFunc)
{
xf86XVInitGenericAdaptorPtr *newdrivers;
- newdrivers = realloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) *
- (1 + NumGenDrivers));
+ newdrivers = reallocarray(GenDrivers, 1 + NumGenDrivers,
+ sizeof(xf86XVInitGenericAdaptorPtr));
if (!newdrivers)
return 0;
GenDrivers = newdrivers;
@@ -159,7 +159,7 @@ xf86XVListGenericAdaptors(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr ** adaptors)
n = (*GenDrivers[i]) (pScrn, &DrivAdap);
if (0 == n)
continue;
- new = realloc(*adaptors, sizeof(XF86VideoAdaptorPtr) * (num + n));
+ new = reallocarray(*adaptors, num + n, sizeof(XF86VideoAdaptorPtr));
if (NULL == new)
continue;
*adaptors = new;
@@ -436,8 +436,8 @@ xf86XVInitAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr * infoPtr, int number)
void *moreSpace;
totFormat *= 2;
- moreSpace = realloc(pFormat,
- totFormat * sizeof(XvFormatRec));
+ moreSpace = reallocarray(pFormat, totFormat,
+ sizeof(XvFormatRec));
if (!moreSpace)
break;
pFormat = moreSpace;