[vlc-commits] block: do not use pass uninitialized data to ReadFile()

Steve Lhomme git at videolan.org
Fri Apr 7 14:28:07 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Apr  5 14:55:10 2017 +0200| [c41af569b2d64be974cf06725c695566429f2089] | committer: Jean-Baptiste Kempf

block: do not use pass uninitialized data to ReadFile()

All the others fields were uninitialized causing ReadFile() to fail.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c41af569b2d64be974cf06725c695566429f2089
---

 src/misc/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/misc/block.c b/src/misc/block.c
index 950f406..10bd5c5 100644
--- a/src/misc/block.c
+++ b/src/misc/block.c
@@ -348,7 +348,7 @@ ssize_t pread (int fd, void *buf, size_t count, off_t offset)
     if (handle == INVALID_HANDLE_VALUE)
         return -1;
 
-    OVERLAPPED olap; olap.Offset = offset; olap.OffsetHigh = (offset >> 32);
+    OVERLAPPED olap = {.Offset = offset, .OffsetHigh = (offset >> 32)};
     DWORD written;
     /* This braindead API will override the file pointer even if we specify
      * an explicit read offset... So do not expect this to mix well with



More information about the vlc-commits mailing list