diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-19 15:28:43 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-19 15:28:43 +0100 |
commit | 06634604abf15fdd27dd007fcf81595da994146b (patch) | |
tree | a316efc23ee9063c76f64cd81f709761eeda5a42 | |
parent | 8bfea58dbc634cadc399d3132030c591e086880c (diff) |
Initialise adaptors to 0 in case xf86XVListGenericAdaptors does not
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/intel_video.c | 6 | ||||
-rw-r--r-- | src/legacy/i810/i810_video.c | 6 | ||||
-rw-r--r-- | src/sna/sna_video.c | 1 |
3 files changed, 5 insertions, 8 deletions
diff --git a/src/intel_video.c b/src/intel_video.c index 235845f2..0e9845d7 100644 --- a/src/intel_video.c +++ b/src/intel_video.c @@ -329,11 +329,9 @@ void I830InitVideo(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); intel_screen_private *intel = intel_get_screen_private(scrn); - XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; + XF86VideoAdaptorPtr *adaptors = NULL, *newAdaptors = NULL; XF86VideoAdaptorPtr overlayAdaptor = NULL, texturedAdaptor = NULL; - int num_adaptors; - - num_adaptors = xf86XVListGenericAdaptors(scrn, &adaptors); + int num_adaptors = xf86XVListGenericAdaptors(scrn, &adaptors); /* Give our adaptor list enough space for the overlay and/or texture video * adaptors. */ diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c index 440f9f73..56d04a48 100644 --- a/src/legacy/i810/i810_video.c +++ b/src/legacy/i810/i810_video.c @@ -155,10 +155,8 @@ static Atom xvBrightness, xvContrast, xvColorKey; void I810InitVideo(ScreenPtr screen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(screen); - XF86VideoAdaptorPtr *adaptors; - int num_adaptors; - - num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); + XF86VideoAdaptorPtr *adaptors = NULL; + int num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); if (pScrn->bitsPerPixel != 8) { XF86VideoAdaptorPtr newAdaptor; diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c index 69995489..08b848b3 100644 --- a/src/sna/sna_video.c +++ b/src/sna/sna_video.c @@ -538,6 +538,7 @@ void sna_video_init(struct sna *sna, ScreenPtr screen) if (!xf86LoaderCheckSymbol("xf86XVListGenericAdaptors")) return; + adaptors = NULL; num_adaptors = xf86XVListGenericAdaptors(sna->scrn, &adaptors); newAdaptors = realloc(adaptors, (num_adaptors + 2) * sizeof(XF86VideoAdaptorPtr)); |