Verified Commit 561599c9 authored by Even Rouault's avatar Even Rouault
Browse files

TIFFReadDirectory(): avoid calling memcpy() with a null source pointer and...

TIFFReadDirectory(): avoid calling memcpy() with a null source pointer and size of zero (fixes #362)
parent 3cab27c2
Pipeline #464312495 passed with stages
in 8 minutes and 20 seconds
......@@ -4177,7 +4177,8 @@ TIFFReadDirectory(TIFF* tif)
goto bad;
}
memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, old_extrasamples * sizeof(uint16_t));
if (old_extrasamples > 0)
memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, old_extrasamples * sizeof(uint16_t));
_TIFFsetShortArray(&tif->tif_dir.td_sampleinfo, new_sampleinfo, tif->tif_dir.td_extrasamples);
_TIFFfree(new_sampleinfo);
}
......
Supports Markdown
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