vc1dec: Update destination pointers in context for fields

This replaces a large number of checks for the second field by
fixing the pointers when they are setup.

This should also fix I/BI field pictures.

Changes checksums for vc1_sa10143, the file becomes slightly closer
to what the reference decoder outputs.

Based on "vc1dec: the second field is written wrong to the picture"
by Sebastian Sandberg <sebastiand.sandberg@gmail.com>.

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1dec: Fix tff == 0 handling in init_block_index()

This fixes several files from VLC ticket 5887.

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1dec: Factorize srcU/V offseting

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1dec: Factorize picture pointer selection code

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1dec: Factorize picture pointer selection in vc1_mc_4mv_chroma()

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1dec: Fix current ptr selection in vc1_mc_4mv_chroma()

No sample tried shows a difference.

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1, mss2: Check for any negative return value from ff_vc1_parse_frame_header

This is required if we return other error codes than explicitly
-1, which so far has been the only other possible return value
besides 0.

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1dec: Do not allow field_mode to change after the first header

This fixes out of array accesses.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1dec: Remove some now unused variables

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1: Move INIT_LUT() further up to allow using it in more places

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1: Simplify code by using INIT_LUT()

Signed-off-by: Martin Storsjö <martin@martin.st>
vc1: Make INIT_LUT() self contained

Move the local variables it uses into the macro, enclosing them
in a do {} while (0) scope.

Signed-off-by: Martin Storsjö <martin@martin.st>
configure: Use linker hardening flags on mingw

This makes it consistent with the msvc builds which automatically set
the DEP and ASLR flags by default.  There really is no good reason why
they shouldn't be set.

The fact that binutils does not set them on by default boggles the mind.

Signed-off-by: Martin Storsjö <martin@martin.st>
lavf/concat: reject empty scripts.

Fix trac ticket #2566.
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  configure: Use linker hardening flags on mingw
  vc1: Make INIT_LUT() self contained
  vc1: Simplify code by using INIT_LUT()
  vc1: Move INIT_LUT() further up to allow using it in more places
  vc1dec: Remove some now unused variables
  vc1dec: Do not allow field_mode to change after the first header
  vc1, mss2: Check for any negative return value from ff_vc1_parse_frame_header
  vc1dec: Fix current ptr selection in vc1_mc_4mv_chroma()
  vc1dec: Factorize picture pointer selection in vc1_mc_4mv_chroma()
  vc1dec: Factorize picture pointer selection code
  vc1dec: Factorize srcU/V offseting
  vc1dec: Fix tff == 0 handling in init_block_index()
  vc1dec: Update destination pointers in context for fields

Conflicts:
	libavcodec/vc1.c
	libavcodec/vc1dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge remote-tracking branch 'cigaes/master'

* cigaes/master:
  lavf/concat: reject empty scripts.

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