Commit 947aebe1 authored by Leslie Zhai's avatar Leslie Zhai

Fix potential null passed to a callee that requires a non-null argument.

BUG: 387298
parent 5c08b051
......@@ -278,15 +278,18 @@ QString K3bFFMpegFile::comment() const
}
int K3bFFMpegFile::read( char* buf, int bufLen )
int K3bFFMpegFile::read(char* buf, int bufLen)
{
if (!buf || !d->outputBufferPos)
return -1;
int ret = fillOutputBuffer();
if (ret <= 0) {
return ret;
}
int len = qMin(bufLen, d->outputBufferSize);
::memcpy( buf, d->outputBufferPos, len );
::memcpy(buf, d->outputBufferPos, len);
// TODO: only swap if needed
for( int i = 0; i < len-1; i+=2 ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment