[FFmpeg-cvslog] lavfi/testsrc: use int in place of unsigned

Stefano Sabatini git at videolan.org
Wed Apr 17 23:07:24 CEST 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Wed Apr 17 21:21:10 2013 +0200| [7ab631261033a71a52563c3b23b6eef826eb5994] | committer: 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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ab631261033a71a52563c3b23b6eef826eb5994
---

 libavfilter/vsrc_testsrc.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 178f55e..d83d996 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -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 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,
-                           unsigned x, unsigned y, unsigned w, unsigned h)
+static void draw_rectangle(unsigned val, uint8_t *dst, int dst_linesize, int segment_width,
+                           int x, int y, int w, int h)
 {
     int i;
     int step = 3;
@@ -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,
-                       unsigned segment_width)
+static void draw_digit(int digit, uint8_t *dst, int dst_linesize,
+                       int segment_width)
 {
 #define TOP_HBAR        1
 #define MID_HBAR        2



More information about the ffmpeg-cvslog mailing list