motion_est: remove dead code

mb_type is initialized to 0 and never updated before the check.

Bug-Id: CID 1238782
motion_est: check for negative index

CC: libav-stable@libav.org
Bug-Id: CID 29387
motion_est: avoid out-of-bounds reads in loop index

Add one extra element to allow space for the insert.

CC: libav-stable@libav.org
Bug-Id: CID 732253 / CID 732254
motion_est: widen before multiply

Bug-Id: CID 700556 / CID 700557 / CID700558
motion_est: prevent an out-of-bounds write

CC: libav-stable@libav.org
Bug-Id: CID 732255
error_resilience: initialize prev_* variables

CC: libav-stable@libav.org
Bug-Id: CID 732293 / CID 732294
ratecontrol: prevent a null pointer dereference in loop

CC: libav-stable@libav.org
Bug-Id: CID 29254
pthreads_frame: Do not leak on failure path

CC: libav-stable@libav.org
Bug-Id: CID 1135767
aacdec: change order of multiplications

Make code safer against too large input values.

CC: libav-stable@libav.org
Bug-Id: CID 700697
aacdec: add default case in channel layout

Bug-Id: CID 732291
mjpegdec: Fix undefined shift

CC: libav-stable@libav.org
Bug-Id: CID 1194388
mjpegenc: fix argument size in encode_mb

CC: libav-stable@libav.org
Bug-Id: CID 1047235
mpegaudio_tablegen: refactor to avoid casting

CC: libav-stable@libav.org
Bug-Id: CID 1238835
mpeg12enc: factor out check in encode_dc

Makes coverity less confused.

CC: libav-stable@libav.org
Bug-Id: CID 751744
mpeg12enc: increase declared size of block function argument

CC: libav-stable@libav.org
Bug-Id: CID 1047236
mpegvideo: check mpv return value

CC: libav-stable@libav.org
Bug-Id: CID 1238786
mpegvideo: x86: avoid integer overflow

CC: libav-stable@libav.org
Bug-Id: CID 700559 / CID 700560
mpegvideo_enc: rework direct mode check

Remove stray semicolon and share codepaths.

CC: libav-stable@libav.org
Bug-Id: CID 991857
mpegvideo_enc: factor out denominator and explicitly cast operands

CC: libav-stable@libav.org
Bug-Id: CID 608053
mpegvideo_parser: check ff_set_dimensions return value

Also correctly propagate errors to mpegvideo_parse.

CC: libav-stable@libav.org
Bug-Id: CID 1135741