Rasterizer: Reallocate memory only once.
Subtitles: Add z-cord limit removed in 8f3d30412adad6bfa152c6ebf8738965bb79cf28.

Without limit we transform points not relalistic to render.

Add const to some values and remove definition of values used only once.
Rasterizer: Remove sanity checks.

They are imperfect and can cause valid "sane" subtitles to not
show. Instead check for memory allocation failures.
Properly catch a bad allocation exception.

On MFC projects `CMemoryException` is thrown instead of the
STL's `std::bad_alloc` exception.
Use nullptr instead of casting 0 to pointer.
Add support for basic RTMP urls
Use internal filters for gif format.

Microsoft's Generate Still Video filter has problems with animation rate and store every
frame (uncompressed) in memory, which for gifs with longer animation can be a problem.

Fixes #4678, #4856