avformat/flac_picture: allocate buffer padding for picture

Fixes: heap array overread
Fixes: asan_heap-oob_14876d9_4706_cov_815472558_cover_art.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/flac_picture: clear padding area

aviod use of uninitialized memory

Fixes: asan_heap-oob_1487fa4_4706_cov_364534849_cover_art.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mjpegdec: pass into ff_mjpeg_decode_sos() and check bitmask size

Fixes: heap array overread
Fixes: asan_heap-oob_149b2bc_6577_m1.mxg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mxpeg_decode_end: zero bitmask size

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Auto-detect hevc in mpeg-ts.

Fixes decoding of files without PMT/PAT.

Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
avcodec/takdec: always check bits_per_raw_sample

Fixes out of array access
Fixes: asan_heap-oob_19c7a94_6470_cov_1453611734_luckynight-partial.tak
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mjpegdec: use the correct linesize in the flipping code

Fixes out of array access
No releases should be affected
Depends on 7c3700cd1d8683966b21fffbf02e326d0bd14e06, do not backport without this one

Fixes: asan_heap-oob_14a37fe_9111_cov_1692584941_test4.amv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge remote-tracking branch 'cehoyos/master'

* cehoyos/master:
  Auto-detect hevc in mpeg-ts.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/vc1dec: field pictures with direct mode MBs, followed by frame pictures are not supported

This case could occur when cuting and concatenating bitstreams

Fixes out of array read
Fixes: asan_heap-oob_1b33fdd_2849_cov_478905890_SA10143.vc1
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/vc1dec: Print warning for frame pictures with direct mode MBs, followed by field pictures

This case is not implemented
No non fuzzed samples are known to use this

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mxf: Handle negative edit_rate

Default to 1/25.
mxf: Read field dominance flag

And export the information in field_order.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
hevc: Consider first quantization group any reference to 0, 0

According to my understanding of T-REC-H.265-2013044 chapter 8.6.1.

Sample-Id: 00001438-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
hevc: Reject impossible slice segment

A dependent slice cannot have address 0.
Prevent an out of array bound load in ff_hevc_cabac_init().

Sample-Id: 00001406-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
avcodec/vc1: factor read_bfraction() out

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/vc1: Check bfraction_lut_index

Fixes: out of array read
Fixes: asan_static-oob_1b40507_2849_SA10143.vc1
Fixes: asan_static-oob_1b40a15_2849_cov_1182297305_SA10143.vc1
Fixes: asan_static-oob_1b40f15_2849_cov_2159513432_SA10143.vc1
Fixes: asan_static-oob_1b40f15_2849_cov_3230311510_SA10143.vc1
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/vc1: reset fcm/field_mode in non advanced header parsing

Fixes NULL pointer dereference
Fixes: signal_sigsegv_1ab8bf4_2847_cov_4254117347_SA10091.vc1
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
RoQ decoder: Remove misleading diagnostics.

It is not necessarily an error when a chunk does not cover a whole block.
Messages did not reflect the actual situation either.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
RoQ-encoder: introducing Quake 3 compatibility option

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avdevice/v4l2: only use frame period from v4l2 if valid

There is evidence that some drivers do not set a valid value

See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718805
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>