VideoToolbox internally sets all the colorspace parameters to BT709,
regardless of what the bitstream actually indicates, so we need to
replace that with what we've parsed.
The check here is meant to check for whether avcintra-class option
(default value -1) has been set; yet it checks for the x264_param_t
value where 0 is the default value (treated as "no avcintra-mode"
by x264). This meant that in-band extradata has been added unnecessarily
when using global headers; furthermore, the first output packet
had two x264 SEIs.
Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
The SDK defines HEVC, VP9 and AV1 profiles in the same values
e.g.
MFX_PROFILE_HEVC_MAIN =1,
MFX_PROFILE_VP9_0 =1,
MFX_PROFILE_AV1_MAIN =1,
To avoid potential errors when adding VP9, AV1 profiles later,
this patch defines profile array per codec.
Signed-off-by: Zhong Li <zhongli_dev@126.com>
The SDK doesn't support VC1 encoding. In addition, both
MFX_PROFILE_VC1_SIMPLE and MFX_PROFILE_HEVC_MAIN are 1 in the SDK, HEVC
main profile is recognized as simple profile in the verbose output if
don't remove VC1 profiles.
$ ffmpeg -v verbose -qsv_device /dev/dri/renderD129 -f lavfi -i
yuvtestsrc -c:v hevc_qsv -f null -
[hevc_qsv @ 0x55bdf7eb4eb0] profile: simple; level: 21
Signed-off-by: Zhong Li <zhongli_dev@126.com>
Every modification of the data that is copied in update_thread_context()
is a data race if it happens after ff_thread_finish_setup. ffv1dec's
update_thread_context() simply uses memcpy for updating the new context,
so that every modification of the src's context is a race.
Some of these modifications are unnecessary: picture_number is write-only
for the decoder and cur will be reset when decoding the next frame anyway.
So remove them. And while just at it, also don't set cur for the slice
contexts as this variable is write-only.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
There is no mxfenc dependency any more since commit
b9a26b9d55.
Also remove a dnxhddata.h inclusion in mxfenc that was forgotten
in the very same commit.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Fixes: signed integer overflow: -16777216 * 131 cannot be represented in type 'int'
Fixes: 23835/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5669943160078336
Fixes: 41101/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-4636330705944576
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Fixes: out of array access
Fixes: 40054/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-6713285764841472
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This is possible by incrementing the counter of allocated rects
directly after said allocation succeeded.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Do this by actually incrementing the counter for the number
of rects at the right time.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Up until now, various subtitle decoders have not cleaned up
the AVSubtitle on error; this task must not be left to the user
because the documentation explicitly states that the AVSubtitle
"must be freed with avsubtitle_free if *got_sub_ptr is set"
(which it isn't on error).
Leaks happen upon failure in ff_ass_add_rect() or in
ass_decode_frame(); freeing generically also allows to remove
now redundant freeing code in pgssubdec and dvbsubdec.
While just at it, also reset got_sub_ptr generically on error.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
The caller of display_end_segment() frees the AVSubtitle on error
in case ENOMEM is returned or err_recognition is set to explode,
so display_end_segment() doesn't have to.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>