wtv: Seek by sector properly

Use an helper function to seek by sector to avoid possible mistakes
due shifting by WTV_SECTOR_BITS a 32bit integer.

Contrary to common intuition, a 32 bit integer left shifted
by a 64 bit integer does not promote the 32 bit integer to
64 bit before shifting.
avformat/wtv: rename to wtv_common

This helps git matchup files on merges correctly

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

* qatar/master:
  wtv: Seek by sector properly

Conflicts:
	libavformat/wtvdec.c

See: a0d13d84a928110b0e99ea16d17fd758fcbde35f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
avformat/wtvdec: drop SHIFT_SECTOR_BITS() macro

it just wraps around a bitwise shift, and makes the code harder to read

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/developer: Add a policy item about updating the MAINTAINERs file

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Do not leave positive values undefined when negative are defined as error

Define positive return values as non errors and leave further meaning undefined
This allows future extensions to use these values

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/avpacket/av_packet_split_side_data: ensure that side data padding is initialized

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/utils: add some saftey checks to add_metadata_from_side_data()

This fixes potential overreads with crafted files.

Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/oggdec: favor av_freep() over av_free()

Found-by: Reimar Döffinger
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/exr: favor av_freep() over av_free() for saftey

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/exr: fix null pointer dereference

Fixes CID1108582

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffv1enc: use 64bit in maxsize calculation

This isnt needed but it cant hurt, its also more consistent with
how its calculated a few lines before.

See: CID1108593
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/h264_parser: fix order of operations

Fixes CID1108576

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/hevc: fix EOB/EOS check

Fixes: CID1108575
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevc: inline cabac in residual coding(cherry picked from commit 17d7a880445b72feb36d684ae1f0597195811e97)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
hevc: inline cabac in hls_mvd_coding(cherry picked from commit ad387195ad04e8a005a1bfd509e9e4f827e68fa9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/hevc_cabac: trivial simplifications

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/hevc: do not dereference pointer before null check in verify_md5()

Fixes: CID1108607

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/hevc_refs: fix h/vshift calculation in ff_hevc_output_frame()

Fixes CID1108577

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/tiff: remove byte based bpp special case

This case does not work as off is uninitialized and it should be
handled fine by the generic code below

Fixes CID1108608

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>