Logo Search packages:      
Sourcecode: libtheora version File versions  Download package

th_dec_ctx* th_decode_alloc ( const th_info _info,
const th_setup_info _setup 

Allocates a decoder instance.

Security Warning: The Theora format supports very large frame sizes, potentially even larger than the address space of a 32-bit machine, and creating a decoder context allocates the space for several frames of data. If the allocation fails here, your program will crash, possibly at some future point because the OS kernel returned a valid memory range and will only fail when it tries to map the pages in it the first time they are used. Even if it succeeds, you may experience a denial of service if the frame size is large enough to cause excessive paging. If you are integrating libtheora in a larger application where such things are undesirable, it is highly recommended that you check the frame size in _info before calling this function and refuse to decode streams where it is larger than some reasonable maximum. libtheora will not check this for you, because there may be machines that can handle such streams and applications that wish to.

_info A th_info struct filled via th_decode_headerin().
_setup A th_setup_info handle returned via th_decode_headerin().
The initialized th_dec_ctx handle.
Return values:
NULL If the decoding parameters were invalid.

Definition at line 1954 of file decode.c.

Referenced by theora_decode_init().

  oc_dec_ctx *dec;
  if(_info==NULL||_setup==NULL)return NULL;
    return NULL;
  return dec;

Generated by  Doxygen 1.6.0   Back to index