avcodec/truemotion2: use av_reallocp_array() and check return value

Also reset tok_lens if reallocation fails.

Fixes #2946.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
avcodec/bmpenc: return meaningful error code

Signed-off-by: Paul B Mahol <onemda@gmail.com>
avcodec/xwdenc: use AV_LOG_ERROR in error message

Signed-off-by: Paul B Mahol <onemda@gmail.com>
avcodec/asfdec: check return value of av_mallocz()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
avcodec/eatgv: use av_reallocp_array() and check return value

Fixes #2949.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
avcodec/util: Make size argument of ff_alloc_packet2() int64_t

This ensures that huge sizes dont get truncated before the check in ff_alloc_packet2()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/ffv1enc: fix size used for ff_alloc_packet2()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/ffv1enc: update buffer check for 16bps

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/ffv1enc: check encode_line()s return code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/ffv1dec: Support decoding planes as raw PCM in 1.4

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/ffv1enc: encode slice as raw PCM in 1.4 when the buffer is too small.

This limits the maximum size of encoded slices more tightly

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