lzw: fix potential integer overflow.
mov: don't overwrite existing indexes.

Prevents all kind of badness if files contain multiple
indexes.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
ffmpeg: check pts like dts for being in the past.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
img2: glob matching for image series

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
img2dec: Recognize glob meta chars only if prefixed by %

  This changes globbing support to only be used if the character
contains at least one glob meta character that is preceded by
an unescaped %. To escape a literal % one would use %% which is
identical to the way to match a % with image2 sequence generation
feature.

* Makes it possible to have patterns like %04d-[720p].jpg work
  again with sequence number generation. Previously this would
  always be detected as a glob pattern and was interpreted by
  the image2 glob code instead.

* Makes it possible to use %*-[720p].jpg to match above pattern
  without having to double escape it to be not interpreted by most
  shells and not by the image2 glob code (previously one would
  need to use \*-\\\[720p\\\].jpg to achieve the same)

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avf: fix audio writing in the output-example

av_init_packet does not reset data and size fields in AVPacket,
avcodec_encode_audio2 can use preallocated AVPacket.
avf: make the example output the proper message

av_dump_format needs the codecs opened in order to print
them.
img2dec: remove GLOB_TILDE support.

tilde expansion should/can be done by the shell

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

* qatar/master:
  mp3dec: perform I/S and M/S only when frame mode is joint stereo.
  id3v2: add another mimetype for JPEG image
  lzw: prevent buffer overreads.
  WMAL: Remove inaccurate and unnecessary doxy
  h264: fix cabac-on-stack after safe cabac reader.
  truemotion2: convert packet header reading to bytestream2.

Conflicts:
	libavcodec/lzw.c
	libavcodec/truemotion2.c
	libavformat/id3v2.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
output-example: K&R formatting cosmetics, comment spelling fixes
h264: Make ff_h264_decode_end() static, it is not used externally.

Also drop the now unnecessary ff_ prefix from its name.
h264: drop ff_h264_ prefix from static function ff_h264_decode_rbsp_trailing()
cavsdec: ensure the tables have been allocated before using them

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat: Fix several "incompatible pointer type" warnings.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
dvbsubdec: Fix "set but not used" warning

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
interplayvideodec: pass correct pointer to av_dlog()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
j2kdec: fix format strings

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
j2kenc: Fix "function declaration isn’t a prototype" warning

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mjpegdec: Fix "assignment from incompatible pointer type" warnings

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mpeghaudiodec: Fix "set but not used" warnings

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