Michael Niedermayer
98dcbb47fa
avcodec/h264: reset list_count too in case of error in ff_set_ref_count()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
9eef9eb301
h264: check that execute_decode_slices() is not called too many times
...
Fixes invalid reads.
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
9a026c7298
h264: rebuild the default ref list if the reference count changes
...
Fixes possible access to freed memory.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
11 years ago
Anton Khirnov
58312b2472
h264: reset data_partitioning if decoding the slice header for NAL_DPA fails
...
If it was set before then we can end up trying to decode a slice without
a valid slice header, which can lead to invalid memory access.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
11 years ago
Dale Curtis
4feca2214a
h264: Clear ERContext.cur_pic when unref'ing current picture.
...
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
11 years ago
Michael Niedermayer
6ea05ef278
avcodec/h264: remove unused variable
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
4d2bb28931
h264: namespace the decode function
...
Make much easier debugging.
11 years ago
Anton Khirnov
598ce4ab4f
h264: call av_frame_unref() instead of avcodec_get_frame_defaults().
...
This is a temporary workaround to allow deprecating
avcodec_get_frame_defaults(). The proper solution will be using a
properly allocated AVFrame in Picture.
11 years ago
Michael Niedermayer
d9339ab553
avcodec/h264: fix code that blindly dereferences NULL DPB
...
Fixes mixed flushing and decoding NULL packets
Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Vittorio Giovara
5b10ef729f
h264: parse frame packing arrangement SEI messages and save relevant stereo3d information
11 years ago
Anton Khirnov
f0259a587e
h264: check buffer size before accessing it
...
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
11 years ago
Anton Khirnov
a553c6a347
lavc: use buf[0] instead of data[0] in checks whether a frame is allocated
...
data[0] may be NULL for valid frames with hwaccel pixel formats.
11 years ago
Ronald S. Bultje
458446acfa
lavc: Edge emulation with dst/src linesize
...
Allow supporting files for which the image stride is smaller than
the maximum block size + number of subpel mc taps, e.g. a 64x64 VP9
file or a 16x16 VP8 file with -fflags +emu_edge.
11 years ago
Anton Khirnov
9eda9d3322
h264: free the tables and uninitialize the context on flush
...
Prevents referencing empty frames when the first packet after the flush
does not contain a frame.
11 years ago
Michael Niedermayer
9e5ef1c5c3
h264: Do not treat the initial frame special in handling of frame gaps
...
The not handling of frame gaps has lead to the lack of a dummy reference
frame, which has lead to the failure of decode_slice_header() which has
lead to one SEI recovery message being skiped which had introduced a
slightly suboptimal recovery point for at least 1 h264 file compared to
JM.
Found-by: Carl & BugMaster
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
08303d7741
hwaccel: Simplify ff_find_hwaccel
...
It is always called by passing fields from an AVCodecContext.
11 years ago
Michael Niedermayer
4fb1221e66
h264: reduce whitespace differences to libav
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
647adc4290
h264: factor "if(h->sei_recovery_frame_cnt >= 0)" out
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
f62dfed3de
h264: simplify frame_recovered code
...
This is a separate commit to ease future bisecting in case it breaks something.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
John Stebbins
28096e0a80
h264: wait for initial complete frame before outputing frames
...
This can be optionally disabled whith the "output_corrupt" flags
option. When in "output_corrupt" mode, incomplete frames are
signalled through AVFrame.flags FRAME_FLAG_INCOMPLETE_FRAME.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Derek Buitenhuis
58d13cea30
h264: Check all allocations
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years ago
Derek Buitenhuis
a483aae7d8
h264: Check all allocations
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
11 years ago
Michael Niedermayer
3c9dd93faa
h264: make flush_change() set mmco_reset
...
This ensures that frames do not get mixed on context reinits
Fixes Ticket2836
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
29ffeef5e7
avcodec/h264: do not trust last_pic_droppable when marking pictures as done
...
This simplifies the code and fixes a deadlock
Fixes Ticket2927
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Ronald S. Bultje
93f305473f
lavc: Convert some remaining strides to ptrdiff_t
11 years ago
Yusuke Nakamura
4baba6c813
h264_parser: Fix POC parsing for the case where MMCO_RESET is present.
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Michael Niedermayer
65c2fe7159
avcodec/h264: call flush_change() on init
...
This ensures that all the non zero fields get setup correctly.
Alternatively their initialization could be duplicated.
Fixes Ticket2738
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Clément Bœsch
b46f19100b
cosmetics: group remaining .name and .long_name.
...
See b2bed9325
.
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Carl Eugen Hoyos
b5f219c904
Print pix_fmt name on h264 context reinitialisation.
11 years ago
Ronald S. Bultje
face578d56
Rewrite emu_edge functions to have separate src/dst_stride arguments.
...
This allows supporting files for which the image stride is smaller than
the max. block size + number of subpel mc taps, e.g. a 64x64 VP9 file
or a 16x16 VP8 file with -fflags +emu_edge.
11 years ago
Ronald S. Bultje
c341f734e5
Convert multiplier for MV from int to ptrdiff_t.
...
This prevents emulated_edge_mc from not undoing mvy*stride-related
integer overflows.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
cab8c5f8e1
h264: do not reinitialize the global cabac tables at each slice header
11 years ago
Rainer Hochecker
71cabb521a
h264: do not discard NAL_SEI when skipping frames
...
Setting AVDISCARD_NONREF (e.g. after flushing) resulted in 100% dropped frames.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Vittorio Giovara
edaba18021
h264: log extradata skip only for non-ignored NALs
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Vittorio Giovara
1cad7171dd
h264: remove an unused static constant
...
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Rainer Hochecker
7d75fb381b
h264: do not discard NAL_SEI when skipping frames
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
93cf7b0195
avcodec/h264: set er.ref_count earlier
...
Fixes Ticket2910
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
626739ebbb
avcodec/h264: Free rbsp_buffer before copying context over it
...
Fixes memleak
Fixes Ticket1900
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
be30e44dd9
avcodec/h264: Zero rbsp_buffer earler to ensure no duplicated pointers can leak
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ecbf838c7d
h264: prevent rbsp_buffer values from becoming duplicated
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
c4e43560fe
h264data: Move some tables to the only place they are used
11 years ago
Diego Biurrun
2a61592573
avcodec: Remove some commented-out debug cruft
11 years ago
Michael Niedermayer
a0c6c8e53e
Revert "Merge commit of 'vdpau: remove old-style decoders'"
...
This reverts commit bf36dc50ea
, reversing
changes made to b7fc2693c7
.
Conflicts:
libavcodec/h264.c
Keeping support for the old VDPAU API has been requested by our VDPAU maintainer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Vittorio Giovara
c1076d8479
h264: check one context_init() allocation
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Vittorio Giovara
5eb488bfa8
h264: use explicit variable names for *_field_flag
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Vittorio Giovara
b3dc260e7f
h264: return meaningful values
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Rémi Denis-Courmont
578ea75a9e
vdpau: remove old-style decoders
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Yusuke Nakamura
a8b19271c3
avcodec: Add output_picture_number to AVCodecParserContext
...
Set output_picture_number in H.264 parser.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago