[libdvdcss-devel] Fix position after partial read in libc_read

Evgeny Grin git at videolan.org
Tue Jan 27 15:40:26 CET 2015


libdvdcss | branch: master | Evgeny Grin <karlson2k at kodi.tv> | Tue Jan 27 15:39:10 2015 +0100| [2ce12e9e2b52955c20804845840d2239fe279674] | committer: Jean-Baptiste Kempf

Fix position after partial read in libc_read

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

> http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=2ce12e9e2b52955c20804845840d2239fe279674
---

 src/device.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/device.c b/src/device.c
index 77c9821..50fc754 100644
--- a/src/device.c
+++ b/src/device.c
@@ -578,10 +578,11 @@ static int libc_read ( dvdcss_t dvdcss, void *p_buffer, int i_blocks )
     /* Handle partial reads */
     if( i_ret != i_size )
     {
-        int i_seek;
+        int i_seek, i_set_pos;
 
+        i_set_pos = dvdcss->i_pos + i_ret_blocks;
         dvdcss->i_pos = -1;
-        i_seek = libc_seek( dvdcss, i_ret_blocks );
+        i_seek = libc_seek( dvdcss, i_set_pos );
         if( i_seek < 0 )
         {
             return i_seek;



More information about the libdvdcss-devel mailing list