ref: 2ce12e9e2b52955c20804845840d2239fe279674
parent: b8171911daa0908ebda3a7868a16f9e70fa375f3
author: Evgeny Grin <[email protected]>
date: Tue Jan 27 10:39:10 EST 2015
Fix position after partial read in libc_read Signed-off-by: Jean-Baptiste Kempf <[email protected]>
--- a/src/device.c
+++ b/src/device.c
@@ -578,10 +578,11 @@
/* 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;