Michael Niedermayer
47a5cde6ac
avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h
Fixes out of array access
Fixes: asan_heap-oob_4d5bb0_682_cov_3124593265_Fraunhofer__a_driving_force_in_innovation__small.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 330863c9f1 )
Conflicts:
libavcodec/h264_slice.c
10 years ago
Andreas Cadhalpun
5302adb323
h264: er: Copy from the previous reference only if compatible
Also use the frame pixel format instead of the one from the codec
context, which is more robust.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit fdc64a1044 )
Conflicts:
libavcodec/h264_slice.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
6ff5c4cd49
avcodec/h264_slice: Use AVFrame diemensions for grayscale handling
The AVFrame values are closer to the AVFrame bitmap changed instead of
the AVCodecContext values, so this should be more robust
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit aef0e0f009 )
Conflicts:
libavcodec/h264_slice.c
10 years ago
Luca Barbato
3b69f245db
h264: Make sure reinit failures mark the context as not initialized
Bug-Id: CVE-2015-3417
CC: libav-stable@libav.org
10 years ago
Rainer Hochecker
07a7f38421
h264: avoid unnecessary calls to get_format
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2197b40189 )
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e617d6f988
avcodec/h264_slice: Dont reset mb_aff_frame per slice
Fixes null pointer dereference
Fixes Ticket4440
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 386601286f )
Conflicts:
libavcodec/h264_slice.c
(cherry picked from commit ce6d38e9ed )
11 years ago
Michael Niedermayer
27993da8e7
avcodec/h264: Fix race between slices where one overwrites data from the next
Fixes non deterministic crash in ticket4408/fuzz2.264
Likely fixes other samples as well
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 43b434210e )
Conflicts:
libavcodec/h264.h
libavcodec/h264_slice.c
(cherry picked from commit dbbc42858e )
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ba59d92128
avcodec/h264: Only reinit quant tables if a new PPS is allowed
Fixes null pointer dereference
Fixes: signal_sigsegv_3042097_3007_cov_1741463594_non_monotone_timestamps1.mkv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c23a0e77dd )
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
1dbfaa34e6
h264: only ref cur_pic in update_thread_context if it is initialized
It may be empty if the previous thread's decode call did not contain a
valid frame.
(cherry picked from commit 0dea4c77cc )
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Michael Niedermayer
6005f375aa
avcodec/h264_slice: assert that reinit does not occur after the first slice
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2fd9ce92af )
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
4d5beea7a1
avcodec/h264_slice: ignore SAR changes in slices after the first
Fixes race condition and null pointer dereference
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 38d5241b7f )
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
2073ab266e
avcodec/h264_slice: Check picture structure before setting the related fields
This might fix a hypothetical race condition
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f111831ed6 )
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7b213e88b5
avcodec/h264_slice: Do not change frame_num after the first slice
Fixes potential race condition
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f906982c94 )
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
9dc8f44829
avcodec/h264: Be more strict on rejecting pps/sps changes
Fixes race condition
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6fafc62b0b )
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
043f326060
avcodec/h264_slice: Clear table pointers to avoid stale pointers
Might fix Ticket3889
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 547fce9585 )
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Rémi Denis-Courmont
09c848855a
h264: Always invoke the get_format() callback
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years ago
Vittorio Giovara
e87f5e4e5f
h264: fully check cropping amount from sps
Even if sps.crop is true, the cropping amount may be zero.
Fixes a sample with a valid but broken container cropping.
11 years ago
Carl Eugen Hoyos
cc0acdbd68
lavc/h264_slice: Add a missing newline to an error message.
11 years ago
Michael Niedermayer
1fa35e4352
avcodec/h264_slice: More complete cleanup in h264_slice_header_init()
Fixes null pointer dereference
Fixes Ticket3873
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
835f798c7d
mpegvideo: cosmetics: Lowercase ugly uppercase MPV_ function name prefixes
11 years ago
Diego Biurrun
2d60444331
dsputil: Split motion estimation compare bits off into their own context
12 years ago
Luca Barbato
2db953f846
h264: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
11 years ago
Justin Ruggles
9e500efdbe
Add av_image_check_sar() and use it to validate SAR
12 years ago
Stefano Sabatini
d381109ce8
lavc/h264_slice: clarify informational message in case of disabled slice multi-threaded decoding
Also suggest what can be done to workaround the limitation.
11 years ago
Michael Niedermayer
5bf5e6b1c0
avcodec/h264: Use named identifier for single thread fall-back return from ff_h264_decode_slice_header()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7eae8cd870
avcodec/h264: fix frame skip code
Fixes Ticket3475
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
9025072e6c
avcodec/h264_slice: support skipping loop filtering for non key frames
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
9140d37af2
avcodec/h264: use the correct level for droping non intra frames
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
0f45e643cc
avcodec/h264_slice: fix macro ()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
67afcefb35
lavc: Add new VDA hwaccel
It leverages the new hwaccel 1.2 features:
- get_buffer2 is never called
- the internal context is automatically initialized/deinitialized
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
12 years ago
Anton Khirnov
a871ef0cc9
hwaccel: Rename priv_data_size to frame_priv_data_size
This describes more accurately what this field is for.
12 years ago
Anton Khirnov
5c1d7246cd
lavc: set AVCodecContext.hwaccel in ff_get_format()
This way each decoder does not have to do the same thing manually.
12 years ago
Anton Khirnov
632ad2248e
lavc: Add an internal wrapper around get_format()
It will be useful in the following commits.
12 years ago
Michael Niedermayer
7ef01a7878
avcodec/h264: mark recovery_cnt==0 frames as keyframes
Fixes Ticket3063
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
9d76dd952f
h264: drop commented out cruft
12 years ago
Carl Eugen Hoyos
ced0d6c14d
Use correct msvc type specifiers for ptrdiff_t and size_t.
The Windows runtime aborts if it finds %t or %z.
Fixes ticket #3472 .
Reviewed-by: Ronald Bultje
12 years ago
Janne Grunau
34c5a6660a
h264: codec reinit: remove statements without effect
avctx->coded_{height,width} will always equal h->{height,width} since
init_dimensions() does that explicitly, Size changes are detected by
changes in mb_{height,width} earlier and propagated through the
needs_reinit variable.
12 years ago
Michael Niedermayer
8710ee11d7
avcodec/h264: clear cur_pic structure instead of duplicating it in ff_h264_update_thread_context()
Fixes crash
Found-by: iive
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
bce2abc936
avcodec/h264: use ff_h264_set_erpic() instead of memset
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
f51d0f39c0
h264: Split h264 slice decoding from nal decoding
12 years ago
Vittorio Giovara
e9a77f4bc0
h264: move macroblock decoding into its own file
12 years ago
Yogender Kumar Gupta
6f7ca1f55b
avcodec/h264: fix Lossless Decoding (Profile 244) for 8x8 Intra Prediction
This is limited to the case where x264_build = -1, to not break x264 decoding
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6102dda1d7
avcodec/h264: h264_set_erpic() clear destination
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
8e92ff2546
avcodec/h264: be more tolerant on what pixel format changes trigger reinits
Fixes Ticket3260
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Vittorio Giovara
d24e9a99a4
h264 does not depend on mpegvideo any more
12 years ago
Vittorio Giovara
e0c16e4e32
mpegvideo: move mpegvideo formats-related defines to mpegutils.h
12 years ago
Vittorio Giovara
136034d86b
h264: Remove MotionEstContext and move the relevant fields to H264Context
Unused buffers scratchpad and temp have been dropped too.
12 years ago
Vittorio Giovara
e3c2d0f3d4
h264: Replace mpegvideo-specific MAX_THREADS by private define
12 years ago
Vittorio Giovara
5d1c2e53ab
h264: Replace mpegvideo-specific MAX_PICTURE_COUNT by private define
12 years ago
Vittorio Giovara
9b749c8274
h264: move relevant fields from Picture to H264Picture
12 years ago