diff options
author | Patrik Kullman <patrik@yes.nu> | 2009-02-12 02:23:25 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-02-12 02:23:25 +0000 |
commit | 2779cdad0787ae99d5bb8014d6e4119f7b4c9c8e (patch) | |
tree | c39bdffe2bee72f6df71b7977f971130a0e0dff1 /ffserver.c | |
parent | 2dc91884652aa586951026dc2d518b9b6957577a (diff) | |
download | ffmpeg-2779cdad0787ae99d5bb8014d6e4119f7b4c9c8e.tar.gz |
Check return value of ffm_write_write_index and ffm_read_write_index.
Patch by Patrik Kullman, patrik at yes dot nu
Originally committed as revision 17174 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ffserver.c b/ffserver.c index 223f1a00a0..9236050e12 100644 --- a/ffserver.c +++ b/ffserver.c @@ -2413,7 +2413,10 @@ static int http_start_receive_data(HTTPContext *c) } c->feed_fd = fd; - c->stream->feed_write_index = ffm_read_write_index(fd); + if ((c->stream->feed_write_index = ffm_read_write_index(fd)) < 0) { + http_log("Error reading write index from feed file: %s\n", strerror(errno)); + return -1; + } c->stream->feed_size = lseek(fd, 0, SEEK_END); lseek(fd, 0, SEEK_SET); @@ -2479,7 +2482,10 @@ static int http_receive_data(HTTPContext *c) feed->feed_write_index = FFM_PACKET_SIZE; /* write index */ - ffm_write_write_index(c->feed_fd, feed->feed_write_index); + if (ffm_write_write_index(c->feed_fd, feed->feed_write_index) < 0) { + http_log("Error writing index to feed file: %s\n", strerror(errno)); + goto fail; + } /* wake up any waiting connections */ for(c1 = first_http_ctx; c1 != NULL; c1 = c1->next) { |