changeset 6394:1a9af4a496f2 libavcodec

remove a memcpy
author lorenm
date Mon, 25 Feb 2008 05:46:53 +0000
parents eaa18f140fb7
children 9259af8a686b
files pngdec.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pngdec.c	Sun Feb 24 18:56:52 2008 +0000
+++ b/pngdec.c	Mon Feb 25 05:46:53 2008 +0000
@@ -262,8 +262,8 @@
         if (s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
             png_filter_row(&s->dsp, s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
                            s->last_row, s->row_size, s->bpp);
-            memcpy(s->last_row, s->tmp_row, s->row_size);
             convert_to_rgb32(ptr, s->tmp_row, s->width);
+            FFSWAP(uint8_t*, s->last_row, s->tmp_row);
         } else {
             /* in normal case, we avoid one copy */
             if (s->y == 0)
@@ -289,7 +289,7 @@
                     break;
                 png_filter_row(&s->dsp, s->tmp_row, s->crow_buf[0], s->crow_buf + 1,
                                s->last_row, s->pass_row_size, s->bpp);
-                memcpy(s->last_row, s->tmp_row, s->pass_row_size);
+                FFSWAP(uint8_t*, s->last_row, s->tmp_row);
                 got_line = 1;
             }
             if ((png_pass_dsp_ymask[s->pass] << (s->y & 7)) & 0x80) {