SDL_VideoModeOK and SDL_SetVideoMode not consistently handling bits_per_pixel argument!

if i pass to SetVideoMode bpp=0, everything is fine and a surface is
created. ( “If bpp is 0, it is treated as the current display bits per
pixel.”)

now im trying to resize the window and want to check if that window size
is ok, with SDL_VideoModeOK.

but if i pass bpp=0 to VideoModeOK, it returns 0 instead of the closest
supported bitdepth as stated in the docs:

“SDL_VideoModeOK returns 0 if the requested mode is not supported under
any bit depth, or returns the bits-per-pixel of the closest available
mode with the given width”.

if i just ignore VideoModeOK and do the resize everything works fine.
but i think VideoModeOK should return something nonzero if i actually
can create the new window size and surface.

videoflas i pass: videoFlags = SDL_OPENGL | SDL_RESIZABLE;

code i use:

videoFlags=0;
bits_per_pixel=0; // use desktop default bitdepth
videoFlags = SDL_OPENGL | SDL_RESIZABLE;
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
surface = SDL_SetVideoMode( _w, _h, bits_per_pixel, videoFlags );

and in my handle events function:

case SDL_VIDEORESIZE:
_check = SDL_VideoModeOK(event.resize.w, event.resize.h,
bits_per_pixel, videoFlags);
if(_check)
{
// never arrives here, because _check is 0