Browse Source

sws: rgb has no range, avoid random results if the user tries to mess with it anyway.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
8edf9b1fa4
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libswscale/utils.c

+ 6
- 0
libswscale/utils.c View File

@@ -789,11 +789,17 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
memcpy(c->srcColorspaceTable, inv_table, sizeof(int) * 4);
memcpy(c->dstColorspaceTable, table, sizeof(int) * 4);

if(!isYUV(c->dstFormat) && !isGray(c->dstFormat))
dstRange = 0;
if(!isYUV(c->srcFormat) && !isGray(c->srcFormat))
srcRange = 0;

c->brightness = brightness;
c->contrast = contrast;
c->saturation = saturation;
c->srcRange = srcRange;
c->dstRange = dstRange;

if (isYUV(c->dstFormat) || isGray(c->dstFormat))
return -1;



Loading…
Cancel
Save