diff options
-rw-r--r-- | src/sna/sna_video_textured.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c index 0e7a2914..3b59cf23 100644 --- a/src/sna/sna_video_textured.c +++ b/src/sna/sna_video_textured.c @@ -66,8 +66,9 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] = { {15, TrueColor}, {16, TrueColor}, {24, TrueColor} }; -#define NUM_TEXTURED_ATTRIBUTES 3 -static XF86AttributeRec TexturedAttributes[NUM_TEXTURED_ATTRIBUTES] = { +//#define NUM_TEXTURED_ATTRIBUTES 3 +#define NUM_TEXTURED_ATTRIBUTES 0 +static XF86AttributeRec TexturedAttributes[] = { {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"}, {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"}, {XvSettable | XvGettable, -1, 1, "XV_SYNC_TO_VBLANK"}, @@ -380,6 +381,7 @@ XF86VideoAdaptorPtr sna_video_textured_setup(struct sna *sna, adaptor = calloc(1, sizeof(XF86VideoAdaptorRec)); video = calloc(nports, sizeof(struct sna_video)); devUnions = calloc(nports, sizeof(DevUnion)); +#if NUM_TEXTURED_ATTRIBUTES attrs = calloc(NUM_TEXTURED_ATTRIBUTES, sizeof(XF86AttributeRec)); if (adaptor == NULL || video == NULL || @@ -391,6 +393,15 @@ XF86VideoAdaptorPtr sna_video_textured_setup(struct sna *sna, free(attrs); return NULL; } +#else + if (adaptor == NULL || video == NULL || devUnions == NULL) { + free(adaptor); + free(video); + free(devUnions); + return NULL; + } + attrs = NULL; +#endif adaptor->type = XvWindowMask | XvInputMask | XvImageMask; adaptor->flags = 0; |