diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/i965_drv_video.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 6586ac3..6c45900 100755 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -2067,6 +2067,18 @@ get_display_attribute(VADriverContextP ctx, VADisplayAttribType type) return NULL; } +static void +i965_display_attributes_terminate(VADriverContextP ctx) +{ + struct i965_driver_data * const i965 = i965_driver_data(ctx); + + if (i965->display_attributes) { + free(i965->display_attributes); + i965->display_attributes = NULL; + i965->num_display_attributes = 0; + } +} + static bool i965_display_attributes_init(VADriverContextP ctx) { @@ -2076,7 +2088,7 @@ i965_display_attributes_init(VADriverContextP ctx) i965->display_attributes = malloc( i965->num_display_attributes * sizeof(i965->display_attributes[0])); if (!i965->display_attributes) - return false; + goto error; memcpy( i965->display_attributes, @@ -2085,21 +2097,14 @@ i965_display_attributes_init(VADriverContextP ctx) ); i965->rotation_attrib = get_display_attribute(ctx, VADisplayAttribRotation); - if (!i965->rotation_attrib) - return false; + if (!i965->rotation_attrib) { + goto error; + } return true; -} - -static void -i965_display_attributes_terminate(VADriverContextP ctx) -{ - struct i965_driver_data * const i965 = i965_driver_data(ctx); - if (i965->display_attributes) { - free(i965->display_attributes); - i965->display_attributes = NULL; - i965->num_display_attributes = 0; - } +error: + i965_display_attributes_terminate(ctx); + return false; } /* |