Signed-off-by: Aneesh Dogra <[email protected]>
---
 libavcodec/pngenc.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index d55d238..654e9a6 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -74,8 +74,7 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size,
         for(x = 0; x < width; x++) {
             j = x & 7;
             if ((mask << j) & 0x80) {
-                memcpy(d, s, bpp);
-                d += bpp;
+                bytestream_get_buffer(&d, s, bpp);
             }
             s += bpp;
         }
@@ -200,8 +199,7 @@ static void png_write_chunk(uint8_t **f, uint32_t tag,
     bytestream_put_be32(f, av_bswap32(tag));
     if (length > 0) {
         crc = crc32(crc, buf, length);
-        memcpy(*f, buf, length);
-        *f += length;
+        bytestream_get_buffer(f, buf, length);
     }
     bytestream_put_be32(f, crc);
 }
@@ -307,8 +305,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned 
char *buf, int buf_size,
     }
 
     /* write png header */
-    memcpy(s->bytestream, ff_pngsig, 8);
-    s->bytestream += 8;
+    bytestream_get_buffer(&s->bytestream, ff_pngsig, 8);
 
     AV_WB32(s->buf, avctx->width);
     AV_WB32(s->buf + 4, avctx->height);
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to