Vittorio Giovara
86e1a35802
h264_ps: Return meaningful error codes and address a memory leak
...
Bug-Id: CID 1026763
10 years ago
Michael Niedermayer
c658269cd1
avcodec/h264_ps: Validate num_units_in_tick/time_scale before setting them in the context
...
This probably makes no big difference but it is more correct
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
7498f2221e
h264: Do not fail on unsupported timing info
...
The spec madandate both time_scale and num_units_in_tick greater than 0,
however since they are not essential for decoding, just ignore the whole
block and try to finish parsing the VUI.
Related to Ticket4445.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Michael Niedermayer
bc48c88918
avcodec/h264: Do not fail with randomly truncated VUIs
...
Fixes Ticket4445
Tested-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
32e06c485b
avcodec/h264_ps: Move truncation check from VUI to SPS
...
This more completely checks for truncation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Anton Khirnov
84f226a3bc
h264: use the correct SPS during PPS parsing
...
There is in general no reason for the currently active SPS to be the one
referenced by the PPS being parsed.
10 years ago
Anton Khirnov
d8a45d2d49
h264_ps: properly check cropping parameters against overflow
...
CC: libav-stable@libav.org
10 years ago
Michael Niedermayer
69aa79365c
avcodec/h264_ps: More completely check the bit depths
...
Fixes out of array read
Fixes: asan_static-oob_30328b6_719_cov_3325483287_H264_artifacts_motion.h264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Christophe Gisquet
6a2bfd52e5
h264_ps: move and export aspect_ratio
...
Needed for filters that may need it, like an SPS bsf.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Gabriel Dume
f929ab0569
cosmetics: Write NULL pointer equality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
10 years ago
Diego Biurrun
cba4e6062a
More correct printf format specifiers
...
This avoids compiler warnings about argument and specifier type mismatch.
11 years ago
Diego Biurrun
cc8163e1a3
avcodec: more correct printf specifiers
11 years ago
Vittorio Giovara
5d1c2e53ab
h264: Replace mpegvideo-specific MAX_PICTURE_COUNT by private define
11 years ago
Vittorio Giovara
ee6280ca12
h264: parse two additional constraint flags
11 years ago
Vittorio Giovara
e70ab7c1f5
h264: add MVCD to the list of High profiles in SPS
...
Also comment all previous profiles.
11 years ago
Michael Niedermayer
44b22bba42
avcodec/h264_ps: fix printed num_reorder_frames value
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Vittorio Giovara
614b9e4db8
h264: use avpriv_request_sample for chroma_format_idc
11 years ago
Vittorio Giovara
3a05767028
h264: store current_sps_id inside the current sps
...
In preparation for MVC support.
11 years ago
Vittorio Giovara
73e8fab31d
h264: print values in case of error
...
Also make error style consistent and drop redundant information.
11 years ago
Anton Khirnov
9ecabd7892
h264: reset num_reorder_frames if it is invalid
...
An invalid VUI is not considered a fatal error, so the SPS containing it
may still be used. Leaving an invalid value of num_reorder_frames there
can result in writing over the bounds of H264Context.delayed_pic.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
11 years ago
Anton Khirnov
bfd26b7ce6
h264: reject mismatching luma/chroma bit depths during sps parsing
...
There is no point in delaying the check and it avoids bugs with a
half-initialized context.
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
11 years ago
Anton Khirnov
94603feb1b
h264_ps: when parsing a VUI fails, only abort when explode is set
...
A VUI doesn't contain anything strictly necessary for decoding.
Apparently there are many samples with truncated VUIs in the wild, this
commit should allow decoding them.
11 years ago
Diego Biurrun
c18838f5eb
h264_ps: Use more meaningful error values
11 years ago
Diego Biurrun
330ad1f6a5
h264_ps: K&R formatting cosmetics
11 years ago
Diego Biurrun
8fed466b0a
h264_ps: Drop commented-out cruft
11 years ago
Diego Biurrun
2a61592573
avcodec: Remove some commented-out debug cruft
11 years ago
Michael Niedermayer
00b1401df6
avcodec/h264_ps: try to support Ambarella AVC
...
Fixes Ticket2763
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6952e2f82a
h264_ps: fix memleak in ff_h264_decode_picture_parameter_set()
...
Fixes: CID1026763
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
edabbfbaf2
ff_h264_decode_seq_parameter_set: dont set h->sps
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
ccdaa31d86
ff_h264_decode_picture_parameter_set: fix return code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
dc35b77b28
ff_h264_decode_picture_parameter_set: use the correct sps
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
c3bd306e78
h264_ps: check croping values
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
5e83d9aced
h264: fully support cropping.
...
Based on a patch by Vittorio Giovara <vittorio.giovara@gmail.com>
Fixes Bug 378.
12 years ago
Diego Biurrun
c242bbd8b6
Remove unnecessary dsputil.h #includes
12 years ago
Michael Niedermayer
bdeb61ccc6
h264: check that luma and chroma depth match
...
Fixes out of array access
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
2c54155407
h264: deMpegEncContextize
...
Most of the changes are just trivial are just trivial replacements of
fields from MpegEncContext with equivalent fields in H264Context.
Everything in h264* other than h264.c are those trivial changes.
The nontrivial parts are:
1) extracting a simplified version of the frame management code from
mpegvideo.c. We don't need last/next_picture anymore, since h264 uses
its own more complex system already and those were set only to appease
the mpegvideo parts.
2) some tables that need to be allocated/freed in appropriate places.
3) hwaccels -- mostly trivial replacements.
for dxva, the draw_horiz_band() call is moved from
ff_dxva2_common_end_frame() to per-codec end_frame() callbacks,
because it's now different for h264 and MpegEncContext-based
decoders.
4) svq3 -- it does not use h264 complex reference system, so I just
added some very simplistic frame management instead and dropped the
use of ff_h264_frame_start(). Because of this I also had to move some
initialization code to svq3.
Additional fixes for chroma format and bit depth changes by
Janne Grunau <janne-libav@jannau.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years ago
Vittorio Giovara
a84fb6e06f
h264: Allow discarding the cropping information from SPS
...
Some 3D systems overload the meaning of the field for other purposes.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Victor Lopez
1c8bf3bfed
h264: fix sps parsing for SVC and CAVLC 4:4:4 Intra profiles
...
Fixes bug 396.
CC: libav-stable@libav.org
12 years ago
Janne Grunau
a421bbfe83
h264: fix memleak on error during SPS parsing
...
Introduced in d7d6efe42b
.
12 years ago
Janne Grunau
072be3e896
h264: set parameters from SPS whenever it changes
...
Fixes a crash in the fuzzed sample sample_varPAR.avi_s26638 with
alternating bit depths.
12 years ago
Janne Grunau
d7d6efe42b
h264: check sps.log2_max_frame_num for validity
...
Fixes infinite or long taking loop in frame num gap code in
the fuzzed sample bipbop234.ts_s223302.
CC: libav-stable@libav.org
12 years ago
Michael Niedermayer
039f4ff4c2
h264: 2nd try at getting sm2v working
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
991f6bf93d
h264: Support SMV2
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Hendrik Leppkes
572781b25f
h264: fix parsing of old lossless profile (profile_idc == 144)
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
ae0312ab2e
h264: print num_reorder_frames in debug output
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Ronald S. Bultje
be391fb6df
h264_ps: declare array of colorspace strings on its own line.
12 years ago
Michael Niedermayer
1d890ec849
h264/decode_scaling_matrices: fix coding order of 8x8 matrixes.
...
This fixes decoding of PPCV444I3_Thomson_A.bits
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
e162733dcd
h264: 12 and 14 bit support
...
This works with I, P and B frames
CAVLC and CABAC
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
acb52d3228
h264: print error on unsupported seperate color planes
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
4330b8bba2
h264: sps: handle more profiles
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago