Skip to content

Commit

Permalink
avfilter/vf_paletteuse: Use int where AVERROR can be returned
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Mar 5, 2015
1 parent 6d7e57e commit 7ccc584
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libavfilter/vf_paletteuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static av_always_inline uint8_t colormap_nearest_iterative(const struct color_no
* Note: r, g, and b are the component of c but are passed as well to avoid
* recomputing them (they are generally computed by the caller for other uses).
*/
static av_always_inline uint8_t color_get(struct cache_node *cache, uint32_t color,
static av_always_inline int color_get(struct cache_node *cache, uint32_t color,
uint8_t r, uint8_t g, uint8_t b,
const struct color_node *map,
const uint32_t *palette,
Expand Down Expand Up @@ -346,7 +346,7 @@ static av_always_inline uint8_t color_get(struct cache_node *cache, uint32_t col
return e->pal_entry;
}

static av_always_inline uint8_t get_dst_color_err(struct cache_node *cache,
static av_always_inline int get_dst_color_err(struct cache_node *cache,
uint32_t c, const struct color_node *map,
const uint32_t *palette,
int *er, int *eg, int *eb,
Expand All @@ -355,7 +355,7 @@ static av_always_inline uint8_t get_dst_color_err(struct cache_node *cache,
const uint8_t r = c >> 16 & 0xff;
const uint8_t g = c >> 8 & 0xff;
const uint8_t b = c & 0xff;
const uint8_t dstx = color_get(cache, c, r, g, b, map, palette, search_method);
const int dstx = color_get(cache, c, r, g, b, map, palette, search_method);
const uint32_t dstc = palette[dstx];
*er = r - (dstc >> 16 & 0xff);
*eg = g - (dstc >> 8 & 0xff);
Expand Down

0 comments on commit 7ccc584

Please sign in to comment.