(wrong string) ée

From: <git_AT_suckless.org>
Date: Fri, 14 Jul 2017 22:00:47 +0200 (CEST)

commit aea3343ed3e0398721ced18a6e3ab72c9ebea850
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Fri Jul 14 22:00:38 2017 +0200
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Fri Jul 14 22:00:38 2017 +0200

    Fix ensend_{frames,rows,pixels}
    
    Signed-off-by: Mattias Andrée <maandree_AT_kth.se>

diff --git a/TODO b/TODO
index ade3fca..cd9e8d1 100644
--- a/TODO
+++ b/TODO
_AT_@ -1,8 +1,3 @@
-HIGH PRIORITY:
- blind-cat-rows and blind-cat-cols randomly produces incorrect results
-
-
-
 blind-transform affine transformation by matrix multiplication, -t for tiling, -s for
                                 improve quality on downscaling (pixels' neighbours must not change).
 blind-primary-key replace a primary with transparency, -g for greyscaled images.
diff --git a/src/stream.c b/src/stream.c
index c21d269..1cfb372 100644
--- a/src/stream.c
+++ b/src/stream.c
_AT_@ -282,12 +282,13 @@ ensend_frames(int status, struct stream *stream, int outfd, size_t frames, const
         for (ret = 0; ret < frames; ret++) {
                 for (p = stream->pixel_size; p; p--) {
                         for (h = stream->height; h; h--) {
- for (w = stream->width; w; w -= n, stream->ptr -= n) {
+ for (w = stream->width; w; w -= n) {
                                         if (!stream->ptr && !enread_stream(status, stream, w))
                                                 goto done;
                                         n = MIN(stream->ptr, w);
                                         if (outfd >= 0)
                                                 enwriteall(status, outfd, stream->buf, n, outfname);
+ memmove(stream->buf, stream->buf + n, stream->ptr -= n);
                                 }
                         }
                 }
_AT_@ -308,12 +309,13 @@ ensend_rows(int status, struct stream *stream, int outfd, size_t rows, const cha
 
         for (ret = 0; ret < rows; ret++) {
                 for (p = stream->pixel_size; p; p--) {
- for (w = stream->width; w; w -= n, stream->ptr -= n) {
+ for (w = stream->width; w; w -= n) {
                                 if (!stream->ptr && !enread_stream(status, stream, w))
                                         goto done;
                                 n = MIN(stream->ptr, w);
                                 if (outfd >= 0)
                                         enwriteall(status, outfd, stream->buf, n, outfname);
+ memmove(stream->buf, stream->buf + n, stream->ptr -= n);
                         }
                 }
         }
_AT_@ -332,12 +334,13 @@ ensend_pixels(int status, struct stream *stream, int outfd, size_t pixels, const
         size_t p, n, ret;
 
         for (ret = 0; ret < pixels; ret++) {
- for (p = stream->pixel_size; p; p -= n, stream->ptr -= n) {
+ for (p = stream->pixel_size; p; p -= n) {
                         if (!stream->ptr && !enread_stream(status, stream, p))
                                 goto done;
                         n = MIN(stream->ptr, p);
                         if (outfd >= 0)
                                 enwriteall(status, outfd, stream->buf, n, outfname);
+ memmove(stream->buf, stream->buf + n, stream->ptr -= n);
                 }
         }
 
Received on Fri Jul 14 2017 - 22:00:47 CEST

This archive was generated by hypermail 2.3.0 : Fri Jul 14 2017 - 22:12:45 CEST