Commit 7ab63126 authored by Stefano Sabatini's avatar Stefano Sabatini

lavfi/testsrc: use int in place of unsigned

Avoid implicit int->unsigned conversion, causing invalid access in case
of negative linesize.

Fix crash with:
ffplay -f lavfi testsrc,vflip
parent 5229b783
...@@ -322,8 +322,8 @@ AVFILTER_DEFINE_CLASS(testsrc); ...@@ -322,8 +322,8 @@ AVFILTER_DEFINE_CLASS(testsrc);
* @param w width of the rectangle to draw, expressed as a number of segment_width units * @param w width of the rectangle to draw, expressed as a number of segment_width units
* @param h height of the rectangle to draw, expressed as a number of segment_width units * @param h height of the rectangle to draw, expressed as a number of segment_width units
*/ */
static void draw_rectangle(unsigned val, uint8_t *dst, int dst_linesize, unsigned segment_width, static void draw_rectangle(unsigned val, uint8_t *dst, int dst_linesize, int segment_width,
unsigned x, unsigned y, unsigned w, unsigned h) int x, int y, int w, int h)
{ {
int i; int i;
int step = 3; int step = 3;
...@@ -337,8 +337,8 @@ static void draw_rectangle(unsigned val, uint8_t *dst, int dst_linesize, unsigne ...@@ -337,8 +337,8 @@ static void draw_rectangle(unsigned val, uint8_t *dst, int dst_linesize, unsigne
} }
} }
static void draw_digit(int digit, uint8_t *dst, unsigned dst_linesize, static void draw_digit(int digit, uint8_t *dst, int dst_linesize,
unsigned segment_width) int segment_width)
{ {
#define TOP_HBAR 1 #define TOP_HBAR 1
#define MID_HBAR 2 #define MID_HBAR 2
......
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