lavf: simplify handling of offset in av_probe_input_buffer()

(cherry picked from commit c1868e7ee7b07b40a0fe15f50df89fe499a01a50)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
lavf: use a fixed width type

It's shorter and more consistent with the rest of the code.

(cherry picked from commit 8b76362836f3c373c3aadc544522edcbef16dd5f)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
lavf: make av_probe_input_buffer more robust

Always use the actually read size as the offset instead of making
possibly invalid assumptions.

Addresses: CVE-2012-6618

(cherry picked from commit 2115a3597457231a6e5c0527fe0ff8550f64b733)

Conflicts:
	libavformat/utils.c

Signed-off-by: Anton Khirnov <anton@khirnov.net>
avformat/utils: fix av_probe_input_buffer2() so it returns the probe score

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c4810fbe4f53d312ba70f251f7ee4f484cbca565)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '8575f5362f98c937758b20ff8512d6767a56208e' into release/1.1

* commit '8575f5362f98c937758b20ff8512d6767a56208e':
  lavf: make av_probe_input_buffer more robust
  lavf: use a fixed width type
  lavf: simplify handling of offset in av_probe_input_buffer()

Conflicts:
	libavformat/utils.c

See: cdce0e8a506cafebe47736d891f5b645b57d14b2 and previous commits
Merged-by: Michael Niedermayer <michaelni@gmx.at>
avformat/utils/av_probe_input_buffer2: Fix pd.buf_size

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6a2064820b52568c05a9ec8f418f18840e7c43cc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/utils/av_probe_input_buffer2: fix offset check

The check could fail if avio_read() read less than requested

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8c3b026a0eeb49464d957b61b0c01cceecc416fd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/utils/av_probe_input_buffer2: fix buffer passed to ffio_rewind_with_probe_data()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 05886c9d4edddb07a4cdc6afee8b30cd9c80b4db)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/utils: av_probe_input_buffer2 decrease difference to libav

This removes the initialization of 2 unused fields
The change was part of c1868e7ee7b07b40a0fe15f50df89fe499a01a50
but wasnt merged as the fields could still be used

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 05c78f345b623a3eed203ab17da6e1419d56abd0)

Conflicts:

	libavformat/utils.c