diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-04-08 13:57:36 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-04-08 13:57:36 +0200 |
| commit | 478b53f935264bdfe4efe394f8d804a1361a6770 (patch) | |
| tree | 31c87de7b67f928ff93b4564e0929d7db2a369f8 /src/stream.h | |
| parent | Update TODO: blind-from-sent (diff) | |
| download | blind-478b53f935264bdfe4efe394f8d804a1361a6770.tar.gz blind-478b53f935264bdfe4efe394f8d804a1361a6770.tar.bz2 blind-478b53f935264bdfe4efe394f8d804a1361a6770.tar.xz | |
Document memory requirements, minor style fixes, more use of BUFSIZ, fix warnings, and fix potential buffer overflow
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
| -rw-r--r-- | src/stream.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/stream.h b/src/stream.h index f2d88ed..a5cebc6 100644 --- a/src/stream.h +++ b/src/stream.h @@ -36,8 +36,7 @@ #define process_multiple_streams(...) nprocess_multiple_streams(1, __VA_ARGS__) #define process_each_frame_two_streams(...) nprocess_each_frame_two_streams(1, __VA_ARGS__) -struct stream -{ +struct stream { size_t frames; size_t width; size_t height; @@ -45,7 +44,8 @@ struct stream char pixfmt[32]; int fd; size_t ptr; - char buf[4096]; + size_t xptr; + char buf[BUFSIZ]; const char *file; size_t headlen; }; @@ -62,13 +62,13 @@ void encheck_compat(int status, const struct stream *a, const struct stream *b); int enread_frame(int status, struct stream *stream, void *buf, size_t n); void nprocess_each_frame_segmented(int status, struct stream *stream, int output_fd, const char* output_fname, - void (*process)(struct stream *stream, size_t n, size_t frame)); + void (*process)(struct stream *stream, size_t n, size_t frame)); void nprocess_two_streams(int status, struct stream *left, struct stream *right, int output_fd, const char* output_fname, - void (*process)(struct stream *left, struct stream *right, size_t n)); + void (*process)(struct stream *left, struct stream *right, size_t n)); void nprocess_multiple_streams(int status, struct stream *streams, size_t n_streams, int output_fd, const char* output_fname, - void (*process)(struct stream *streams, size_t n_streams, size_t n)); + void (*process)(struct stream *streams, size_t n_streams, size_t n)); void nprocess_each_frame_two_streams(int status, struct stream *left, struct stream *right, int output_fd, const char* output_fname, void (*process)(char *restrict output, char *restrict lbuf, char *restrict rbuf, |
