tempfile generation bug (Bug #2117)


Added by sebastien wybo over 12 years ago. Updated over 12 years ago.


Status:Done Start date:2012-06-29
Priority:Low Due date:
Assignee:Andrey Kamaev % Done:

0%

Category:core
Target version:2.4.2
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Non android versions of OpenCV (2.2 to 2.4.1 at least) use tmpnam to generate a temp file. This function is called every time imencode is used...
Problem is that tmpnam can only be called 32767 times before failing (at least on windows) and it can happen (rarely but we just had the case here) that we have to use imencode more than 32767 times...

using tmpnam_s on windows will solve the issue (up to 4 billions tmp files at least) don't know if this secured version is supported elsewhere


History

Updated by Andrey Kamaev over 12 years ago

tmpnam is not used in OpenCV any more. In case of Windows OpenCV is limited to 65535 unique file names but it should not be a problem for imencode. Upcoming OpenCV 2.4.2 should fix your problem.

  • Status changed from Open to Done
  • Priority changed from High to Low
  • Target version set to 2.4.2
  • Assignee changed from Vadim Pisarevsky to Andrey Kamaev

Updated by sebastien wybo over 12 years ago

Why not use tmpnam_s which authorizes 2^32 files rather than GetTempFileA as is currently done in trunk (and which overloads at 2^16)?

Also available in: Atom PDF