g2meet: Respect cursor_stride properly everywhere

This fixes a regression with rgb cursors since b1e46988.

Signed-off-by: Martin Storsjö <martin@martin.st>
avcodec/lagarith: check scaled probabilities

Prevents infinite loop
Fixes Ticket2988

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/wmaprodec: check that there are input bits left in decode_subframe_length()

Fixes infinite loop
Fixes Ticket2987

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/flicvideo: fix infinite loops

Fixes #2995.
Reported-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
avcodec/wmalosslessdec: Fix return code for invalid buffer sizes

Fixes infinite loop
Fixes Ticket2979

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mpegenc: improve field names in underflow error message

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mpegenc: change assert to av_assert0

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mpegenc: Better default for max_delay

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mpegenc: Better heuristic for ordering packets

This prevents underflows in quite constrained cases

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  g2meet: Respect cursor_stride properly everywhere

See: c88ac1e0233f34582312dc617261b9270b61df19
Merged-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mpegenc: minor simplification / use AV_WB16()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/wavdec: check smv_frames_per_jpeg

Values outside would not be possible due to limitations of jpeg itself

Fixes very long running loop
Fixes Ticket2977

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mpegts: check avio_tell() return code before using it

Fixes Ticket2962

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/parser: reset indexes on realloc failure

Fixes Ticket2982

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tls: Add options for verifying the peer certificate

A file containing the trusted CA certificates needs to be
supplied via the ca_file AVOption, unless the TLS library
has got a system default file/database set up.

This doesn't check the hostname of the peer certificate with
openssl, which requires a non-trivial piece of code for
manually matching the desired hostname to the string provided
by the certificate, not provided as a library function.

That is, with openssl, this only validates that the received
certificate is signed with the right CA, but not that it is
the actual server we think we're talking to.

Verification is still disabled by default since we can't count
on a proper CA database existing at all times.

Signed-off-by: Martin Storsjö <martin@martin.st>
http: Pass options through to the nested protocol

When passing a dict to the nested protocol, it will consume
the used options from it, so a separate copy needs to be used
when reopening the connection multiple times.

Signed-off-by: Martin Storsjö <martin@martin.st>
tls: Add support for listen mode

Also add options for specifying a certificate and key, which can
be used both when operating as client and as server.

Partially based on a patch by Peter Ross.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtpdec_qt: Add an accidentally removed allocation return value check

This check was mistakenly removed in 5626f994f.

Signed-off-by: Martin Storsjö <martin@martin.st>
lavf: Allocate arrays with av_realloc if they will be realloced later

Pointers returned from av_malloc can't in general be passed
to av_realloc.

Signed-off-by: Martin Storsjö <martin@martin.st>
lavf: Reset the entry count and allocation size variables on av_reallocp failures

When av_reallocp fails, the associated variables that keep track of
the number of elements in the array (and in some cases, the
separate number of allocated elements) need to be reset.

Not all of these might technically be needed, but it's better to
reset them if in doubt, to make sure variables don't end up
conflicting.

Signed-off-by: Martin Storsjö <martin@martin.st>