Commit 00bc783d authored by mercury233's avatar mercury233

fix seek 0 in JPG & PNG loader

parent e203c684
......@@ -141,7 +141,7 @@ IImage* CImageLoaderJPG::loadImage(io::IReadFile* file) const
return 0;
#else
if (!file)
if (!(file && file->seek(0)))
return 0;
Filename = file->getFileName();
......
......@@ -69,7 +69,7 @@ bool CImageLoaderPng::isALoadableFileExtension(const io::path& filename) const
bool CImageLoaderPng::isALoadableFileFormat(io::IReadFile* file) const
{
#ifdef _IRR_COMPILE_WITH_LIBPNG_
if (!file)
if (!(file && file->seek(0)))
return false;
png_byte buffer[8];
......@@ -89,7 +89,7 @@ bool CImageLoaderPng::isALoadableFileFormat(io::IReadFile* file) const
IImage* CImageLoaderPng::loadImage(io::IReadFile* file) const
{
#ifdef _IRR_COMPILE_WITH_LIBPNG_
if (!file)
if (!(file && file->seek(0)))
return 0;
video::IImage* image = 0;
......
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