mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Tile-based output filename may not exist, check g_stat return value
This commit is contained in:
@@ -917,8 +917,9 @@ class PipelineWorker : public Nan::AsyncWorker {
|
||||
} else {
|
||||
// Add file size to info
|
||||
GStatBuf st;
|
||||
g_stat(baton->fileOut.data(), &st);
|
||||
Set(info, New("size").ToLocalChecked(), New<v8::Uint32>(static_cast<uint32_t>(st.st_size)));
|
||||
if (g_stat(baton->fileOut.data(), &st) == 0) {
|
||||
Set(info, New("size").ToLocalChecked(), New<v8::Uint32>(static_cast<uint32_t>(st.st_size)));
|
||||
}
|
||||
argv[1] = info;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user