Diego Biurrun
f3298f1299
Return proper error code after av_log_ask_for_sample()
12 years ago
Michael Niedermayer
985aa0be82
h264: Detect POC inconsistencies and try to handle them reasonably
...
Improves the file from Ticket2050
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Ronald S. Bultje
8c53d39e7f
lavc: introduce VideoDSPContext
...
Move some functions from dsputil. The idea is that videodsp contains
functions that are useful for a large and varied set of video decoders.
Currently, it contains emulated_edge_mc() and prefetch().
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Michael Niedermayer
a9275b4f69
h264: Fix code to also handle pix format changes.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
8525fa7c2c
h264: remove unused variable
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
ca4dd3810e
h264: use must_reinit to simplify code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
af0fafcb6f
h264: decode_update_thread_context() copy parameter sets before using them
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
e33811bd26
h264: remove reschange blocking
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
c2dfb1e37c
h264: support frame size changes with multi threading
...
Based on code by Janne Grunau
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
8ea4a5533f
h264: move h264_set_parameter_from_sps() call up
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
afc03268b4
h264: move list_count and current_slice reset to flush_change()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
971c469a0d
h264: split flush_change() out of flush_dpb()
...
Based on a patch by Janne Grunau
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
25a0af51da
h264: factor get_pixel_format() out
...
Based on patch by Janne Grunau
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Janne Grunau
9e696d2e5f
h264: support frame parameter changes during frame-mt
...
Fixes CVE-2012-2782.
12 years ago
Janne Grunau
f1d8763a02
mpegvideo: allocate scratch buffers after linesize is known
...
Since we can't know which stride a custom get_buffer() implementation is
going to use we have to allocate this scratch buffers after the linesize
is known. It was pretty safe for 8 bit per pixel pixel formats since we
always allocated memory for up to 16 bits per pixel. It broke hoever
with cmdutis.c's alloc_buffer() and high pixel bit depth since it
allocated larger edges than mpegvideo expected.
Fixes fuzzed sample nasa-8s2.ts_s244342.
12 years ago
Michael Niedermayer
14f79ba18f
h264: remove redundant parts of old slice in extradata code.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
99321d1b03
h264: merge old and new "slice in extradata" checks
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Janne Grunau
61c6eef545
h264: prevent decoding of slice NALs in extradata
...
It is not posible to call get_buffer during frame-mt codec
initialization. Libavformat might pass huge amounts of data as
extradata after parsing broken files. The 'extradata' for the fuzzed
sample sample_varPAR_s5374_r001-02.avi is 2.8M large and contains
multiple slices.
12 years ago
Michael Niedermayer
7973a07590
h264: Improve first slice and slice type checks
...
This prevents a null pointer dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
d7599bd8e2
h264: dont mess with frame gaps on second fields.
...
Fixes assertion failure
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Janne Grunau
27c8337e59
h264-mt: handle NAL_DPAs before calling ff_thread_finish_setup
...
Since a NAL_DPA can start a new frame it has to be handled before
ff_thread_finish_setup is called.
12 years ago
Michael Niedermayer
3b5c0f5e36
h264: remove low_delay/has_b_frame setting code from nal loop
...
This code is now executed in h264_set_parameter_from_sps()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
0eae920c3c
h264: initialize frame-mt context copies properly
12 years ago
Michael Niedermayer
c3bb3334f6
h264: dont try to allocate scratchpad if linesize is not known
...
Fixes out of array access
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
ba0c898120
cosmetics: Fix dropable --> droppable typo
12 years ago
Michael Niedermayer
e8ca7cfa4f
h264: avoid calling idr() twice
...
Fixes rare race condition leading to null pointer dereferences.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Janne Grunau
a394959bbe
h264: add a pointer for weighted prediction temporary buffer
...
Reusing MpegEncContext's obmc_scratchpad for this becomes a mess with
adaptive frame-mt.
12 years ago
Janne Grunau
3ab5f7dc13
h264: slice-mt: check master context for valid current_picture_ptr
...
Fixes errors in slice based multithreading introduced in 0b300daad2
.
12 years ago
Janne Grunau
24c62ea7a5
h264: slice-mt: get last_pic_dropable from master context
...
Fixes fate-h264-conformance-cvnlfi2_sony_h and smllwebdl.mkv from
https://github.com/OpenELEC/OpenELEC.tv/issues/1557 .
12 years ago
Janne Grunau
5945c7b35d
h264: slice-mt: check master context for valid current_picture_ptr
...
Fixes errors in slice based multithreading introduced in 0b300daad2
.
CC: libav-stable@libav.org
12 years ago
Janne Grunau
a8cb1746c5
h264: slice-mt: get last_pic_dropable from master context
...
Fixes fate-h264-conformance-cvnlfi2_sony_h and smllwebdl.mkv from
https://github.com/OpenELEC/OpenELEC.tv/issues/1557 .
CC: libav-stable@libav.org
12 years ago
Anton Khirnov
df9b956751
lavc: fix decode_frame() third parameter semantics for video decoders
...
It's got_frame, not data size
12 years ago
Janne Grunau
0b300daad2
h264: error out on unset current_picture_ptr for h->current_slice > 0
...
Fixes a segfault with fuzzed sample sample_varPAR_s11622_r001-02.avi.
CC: libav-stable@libav.org
12 years ago
Michael Niedermayer
936eaa89be
h264: check for integer overflow, fix null pointer dereference
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Janne Grunau
c1fcf563b1
h264: check context state before decoding slice data partitions
...
Fixes mov_h264_aac__Demo_FlagOfOurFathers.mov.SIGSEGV.4e9.656.
Found-by: Mateusz "j00ru" Jurczyk
CC: libav-stable@libav.org
12 years ago
Michael Niedermayer
93b89868e1
h264: support invalid annex B in mp4
...
Fixes Ticket1914
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Janne Grunau
d5e83122bd
h264: set Picture.owner2 to the current thread
...
This does not seem to have an effect currently. Fate-h264 passes with
THREADS=1..16 and both threading types as before. It fixes however a
segfault during error resilience with my adaptive-frame-mt patchset.
A picture in use during error resilience gets realloced in another
thread in the fuzzed sample sample_varPAR.avi_s226019.
12 years ago
Janne Grunau
6e5cdf2628
h264: check ref_count validity for num_ref_idx_active_override_flag
...
Fixes segfault in the fuzzed sample bipbop234.ts_s226407.
CC: libav-stable@libav.org
12 years ago
Janne Grunau
150b2361ca
h264: add missing new line to log message
12 years ago
Sergio Garcia Murillo
ec51b3308e
h264: Fix minor bug in h264.c error trace
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Janne Grunau
706acb558a
h264: enable low delay only if no delayed frames were seen
...
Dropping frames is undesirable but that is the only way by which the
decoder could return to low delay mode. Instead emit a warning and
continue with delayed frames.
Fixes a crash in fuzzed sample nasa-8s2.ts_s20033 caused by a larger
than expected has_b_frames value. Low delay keeps getting re-enabled
from a presumely broken SPS.
CC: libav-stable@libav.org
12 years ago
Michael Niedermayer
ba353436a3
h264: dont stop parsing NALs without cleanup on DPC.
...
Fixes a deadlock with frame threads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
d6c184880e
h264: correct ref count check and limit, fix out of array accesses.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
2d5f1addbe
h264: fix integer overflow, assert failure
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
4fecc3cf09
h264: Skip odd NALs in extradata, prevent undefined behavior
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Janne Grunau
e6160bda98
h264: Fix parameters to ff_er_add_slice() call
...
s->mb_x is reset to zero a couple of lines above. It does not make
sense to call ff_er_add_slice() with 0 as endx when the end of the
macroblock row was reached. Fixes unnecessary and counterproductive
error resilience in https://bugzilla.libav.org/show_bug.cgi?id=394 .
CC: libav-stable@libav.org
12 years ago
Janne Grunau
60b6b8c019
h264: always check ref_count for validity
...
Fixes a crash with zuffed files.
12 years ago
Paul B Mahol
011f3892ff
h264: use designated initializers for AVClass
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Diego Biurrun
f75f4194d1
Restructure av_log_missing_feature message
...
Some invocations include a verb in the log message, others do not. Yet
av_log_missing_feature expects callers to provide a verb. Change the
function to include a verb instead and update the callers accordingly.
The result is a more natural function API and correct English in the
function invocations.
12 years ago