From 364889cf9c1f3c5e816a30d30d714a84765cfc29 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Wed, 25 May 2011 20:12:17 +0200 Subject: [PATCH] Return -1 on invalid input instead of crashing. --- libswscale/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index 56920a10a3..fada19210b 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -710,7 +710,7 @@ int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation) { - if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return -1; + if (!c || isYUV(c->dstFormat) || isGray(c->dstFormat)) return -1; *inv_table = c->srcColorspaceTable; *table = c->dstColorspaceTable;