]> git.sesse.net Git - mlt/commitdiff
kino/filehandler.cc: check return value from lseek()
authorMikko Rapeli <mikko.rapeli@iki.fi>
Tue, 31 Jul 2012 08:07:18 +0000 (10:07 +0200)
committerMikko Rapeli <mikko.rapeli@iki.fi>
Mon, 6 Aug 2012 16:37:26 +0000 (18:37 +0200)
Fixes Coverity CID 709329: Unchecked return value (CHECKED_RETURN)
Calling function "lseek" without checking return value (as is done elsewhere 19 out of 20 times).
No check of the return value of "lseek(this->fd, 0L, 0)".
409        lseek( fd, 0, SEEK_SET );

src/modules/kino/filehandler.cc

index bae33e0bc2b10609c9566046d3689e416fe72bdb..ad964b491f44eb2c2dd2b808a4e29f6a933d4d2c 100644 (file)
@@ -411,7 +411,8 @@ bool RawHandler::Open( const char *s )
                return false;
        if ( read( fd, data, 4 ) < 0 )
                return false;
-       lseek( fd, 0, SEEK_SET );
+       if ( lseek( fd, 0, SEEK_SET ) < 0 )
+               return false;
        numBlocks = ( ( data[ 3 ] & 0x80 ) == 0 ) ? 250 : 300;
        filename = s;
        return true;