avcodec: fix aac/ac3 parser bitstream buffer size

Buffers containing copies of the AAC and AC3 header bits were not padded
before parsing, violating init_get_bits() buffer padding requirement,
leading to potential buffer read overflows.
This change adds FF_INPUT_BUFFER_PADDING_SIZE bytes to the bit buffer
for parsing the header in each of aac_parser.c and ac3_parser.c.

Based on patch by: Matt Wolenetz <wolenetz@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/fic: Check if a frame is available before using it

Fixes null pointer dereference
Fixes: ficvf.avi
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
wavpackenc: fix number of samples per block

Currently, the encoder will try to reduce it down to 150000, but the
decoder will complain starting at 131072 (WV_MAX_SAMPLES). Therefore,
change the loop limit.

Fixes ticket #3881.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
wavpackenc: make assert more thorough

It was only validating that normal data wasn't filling the buffer.
However, extra data may be written afterwards.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
rv34: use ff_mpeg_update_thread_context only when decoder is fully initialized

MpegEncContext based decoders are only fully initialized after the first
ff_thread_get_buffer() call. The RV30/40 decoders may fail before a frame
buffer was requested. ff_mpeg_update_thread_context() fails on half
initialized MpegEncContexts. Since this can only happen before a the
first frame was decoded there is no need to call
ff_mpeg_update_thread_context().

Based on patches by John Stebbins and tested by John Stebbins.

CC: libav-stable@libav.org
electronicarts: do not fail on zero-sized chunks

At least one FATE sample contains such chunks and happens to work simply
by accident (due to find_stream_info() swallowing the error).

CC: libav-stable@libav.org
electronicarts: read the framerate for MAD
electronicarts: set the framerate for TGQ/TQI

It is hardcoded to 15fps.
x86: hevc_mc: assume 2nd source stride is 64

Reviewed-by: Mickaël Raulet <mraulet@gmail.com
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ogg: Provide aliases for Speex, Opus and audio-only ogg

Since they are aliases for ogg enabling any of them enables ogg as well.
hevc: move MAX_PB_SIZE declaration

Reviewed-by: Mickaël Raulet <mraulet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevcdsp: remove compilation-time-fixed parameter

The dststride parameter is always MAX_PB_SIZE.

Reviewed-by: Mickaël Raulet <mraulet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevcdsp: remove more instances of compile-time-fixed parameters

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
x86: hevcdsp: use compilation-time-fixed constant

The stride for some buffers is known.

Reviewed-by: Mickaël Raulet <mraulet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
os_support: Undefine lseek/stat/fstat before defining them

This avoids a number of redefinition warnings on MinGW64.
qt-faststart: Undefine fseeko/ftello before defining them

This avoids a number of redefinition warnings on MinGW64.
Merge commit 'b0bfd09f88da8b7c7666faf0ac7d5e74559dba9f'

* commit 'b0bfd09f88da8b7c7666faf0ac7d5e74559dba9f':
  configure: Suppress "potentially uninitialized variable" warnings from MSVC

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'dc4b2e7d33903a6b9380e8a84b22b3a20facbb08'

* commit 'dc4b2e7d33903a6b9380e8a84b22b3a20facbb08':
  rv34: use ff_mpeg_update_thread_context only when decoder is fully initialized

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '4d6c5152849e23a4cc0f6a6ac2880c01ebcd301b'

* commit '4d6c5152849e23a4cc0f6a6ac2880c01ebcd301b':
  electronicarts: do not fail on zero-sized chunks

Conflicts:
	libavformat/electronicarts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
wavpack: check number of channels

This means container and codec disagree. The codec is supposed to
know better so this could be an error instead.