author | sandman <sandman> | 2002-12-11 18:35:16 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-11 18:35:16 (UTC) |
commit | 8ca42b97de03ac84da04b9be84f9bbb8eb17b52d (patch) (unidiff) | |
tree | 07e9ed49638eadda2dc475aa965562d199932826 | |
parent | b8db7cfea977d20f2d491b0a208a237efb15019a (diff) | |
download | opie-8ca42b97de03ac84da04b9be84f9bbb8eb17b52d.zip opie-8ca42b97de03ac84da04b9be84f9bbb8eb17b52d.tar.gz opie-8ca42b97de03ac84da04b9be84f9bbb8eb17b52d.tar.bz2 |
valgrind complained and here are some off-by-1 fixes
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 791818e..0833784 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -48,15 +48,16 @@ | |||
48 | // 0 deg rot: copy a line from src to dst (use libc memcpy) | 48 | // 0 deg rot: copy a line from src to dst (use libc memcpy) |
49 | 49 | ||
50 | // 180 deg rot: copy a line from src to dst reversed | 50 | // 180 deg rot: copy a line from src to dst reversed |
51 | 51 | ||
52 | static inline void memcpy_rev ( void *dst, void *src, size_t len ) | 52 | static inline void memcpy_rev ( void *dst, void *src, size_t len ) |
53 | { | 53 | { |
54 | ((char *) src ) += len; | ||
55 | |||
56 | len >>= 1; | 54 | len >>= 1; |
55 | |||
56 | ((char *) src ) += ( len << 1 ); | ||
57 | |||
57 | while ( len-- ) | 58 | while ( len-- ) |
58 | *((short int *) dst )++ = *--((short int *) src ); | 59 | *((short int *) dst )++ = *--((short int *) src ); |
59 | } | 60 | } |
60 | 61 | ||
61 | // 90 deg rot: copy a column from src to dst | 62 | // 90 deg rot: copy a column from src to dst |
62 | 63 | ||
@@ -189,13 +190,13 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
189 | memset ( dst, 0, leftfill ); // "left" border -> black | 190 | memset ( dst, 0, leftfill ); // "left" border -> black |
190 | 191 | ||
191 | if ( framefill ) { // blit in the video frame | 192 | if ( framefill ) { // blit in the video frame |
192 | // see above for an explanation of the different memcpys | 193 | // see above for an explanation of the different memcpys |
193 | 194 | ||
194 | switch ( rot ) { | 195 | switch ( rot ) { |
195 | case 0: memcpy ( dst + leftfill, src, framefill ); break; | 196 | case 0: memcpy ( dst + leftfill, src, framefill & ~1 ); break; |
196 | case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; | 197 | case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; |
197 | case 2: memcpy_rev ( dst + leftfill, src, framefill ); break; | 198 | case 2: memcpy_rev ( dst + leftfill, src, framefill ); break; |
198 | case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; | 199 | case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; |
199 | default: break; | 200 | default: break; |
200 | } | 201 | } |
201 | } | 202 | } |