When blending a source layer with an alpha of 'a' on top of another
destination layer we take the sum of:
* 'a' percent of the source layer
* (100 - 'a') percent of the destination layer (the remainder)
Once buffering has started (with an mdat atom), continue buffering
until moov atom is reached, which handles cases with multiple
mdat atoms. Also keep adapter/offset better in sync with upstream
and fix some debug statements. Fixes#587426.
This reverts commit 5503a59a57.
Reverting this since it causes regressions with a lot of sample files
I have, all of which worked fine with the last -good release (#586891).
Whenever we alloc something based on a user-supplied size, we should
really use g_try_new(), otherwise we can easily be made to abort by
passing a ridiculously large number to us for allocing. Fixes
problems with some fuzzed files.
Check the possibly 64-bit atom size more carefully before casting it
to an int and passing it to gst_pad_pull_range(), otherwise we might
end up pulling 0 bytes, getting an empty buffer as requested and
dereferencing not available data whilst thinking we actually asked
for and got 0x1000000000000 bytes. Similar fix for push mode operation
where neededbytes ends up being 0 bytes, which makes us assert. Fixes
crash with broken or fuzzed file (NB #122378).
Fix the caps to include the depth (instead of width twice) in the caps of
audio/x-raw-int.
Fix negotiation to not only copy the rate/channels of the first structure.
Don't call gst_avi_demux_src_convert() for each single index entry. Not
only do we already have the pointer to the stream context, we also know
the formats we want to convert from and to already, so we may just as
well use optimised conversion routines that bypass some of the checks
and lookups made in gst_avi_demux_src_convert().
Include the header from where we include all the system headers with the
socket stuff before we try to define EAI_ADDRFAMILY ourselves, otherwise
we define it ourselves and then get a compiler warning if a system header
defines it as well without guarding against it being defined already.
Don't leak buffers when resyncing to a keyframe.
Avoid leaking buffers when exiting the loop on error conditions.
Add some more debug info.
Fixes#585911