Commit 4a2599b0 authored by Michael Niedermayer's avatar Michael Niedermayer

transform: give avfilter_transform() a return value for returning an error

Fixes CID703674
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 5f531386
...@@ -146,7 +146,7 @@ static inline int mirror(int v, int m) ...@@ -146,7 +146,7 @@ static inline int mirror(int v, int m)
return v; return v;
} }
void avfilter_transform(const uint8_t *src, uint8_t *dst, int avfilter_transform(const uint8_t *src, uint8_t *dst,
int src_stride, int dst_stride, int src_stride, int dst_stride,
int width, int height, const float *matrix, int width, int height, const float *matrix,
enum InterpolateMethod interpolate, enum InterpolateMethod interpolate,
...@@ -167,6 +167,8 @@ void avfilter_transform(const uint8_t *src, uint8_t *dst, ...@@ -167,6 +167,8 @@ void avfilter_transform(const uint8_t *src, uint8_t *dst,
case INTERPOLATE_BIQUADRATIC: case INTERPOLATE_BIQUADRATIC:
func = interpolate_biquadratic; func = interpolate_biquadratic;
break; break;
default:
return AVERROR(EINVAL);
} }
for (y = 0; y < height; y++) { for (y = 0; y < height; y++) {
...@@ -195,5 +197,6 @@ void avfilter_transform(const uint8_t *src, uint8_t *dst, ...@@ -195,5 +197,6 @@ void avfilter_transform(const uint8_t *src, uint8_t *dst,
dst[y * dst_stride + x] = func(x_s, y_s, src, width, height, src_stride, def); dst[y * dst_stride + x] = func(x_s, y_s, src, width, height, src_stride, def);
} }
} }
return 0;
} }
...@@ -116,8 +116,9 @@ void avfilter_mul_matrix(const float *m1, float scalar, float *result); ...@@ -116,8 +116,9 @@ void avfilter_mul_matrix(const float *m1, float scalar, float *result);
* @param matrix 9-item affine transformation matrix * @param matrix 9-item affine transformation matrix
* @param interpolate pixel interpolation method * @param interpolate pixel interpolation method
* @param fill edge fill method * @param fill edge fill method
* @return negative on error
*/ */
void avfilter_transform(const uint8_t *src, uint8_t *dst, int avfilter_transform(const uint8_t *src, uint8_t *dst,
int src_stride, int dst_stride, int src_stride, int dst_stride,
int width, int height, const float *matrix, int width, int height, const float *matrix,
enum InterpolateMethod interpolate, enum InterpolateMethod interpolate,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment