1、fix cve 2、add version 3、modify version in README.OpenSource 4、delete avconfig.h and ffversion

Signed-off-by: gg0907 <guohui_1701@163.com>
This commit is contained in:
gg0907 2022-04-01 13:58:26 +08:00
parent a6af9cfdb4
commit 28f9b7daac
14 changed files with 49 additions and 41 deletions

View File

@ -3,7 +3,7 @@
"Name": "FFmpeg",
"License": "LGPL V2.1/LGPL V3.0/GPL V2.0/GPL V3.0",
"License File": "COPYING.LGPLv2.1/COPYING.LGPLv3/COPYING.GPLv2/COPYING.GPLv3",
"Version Number": "4.3.1",
"Version Number": "4.3.2",
"Upstream URL": "http://www.ffmpeg.org/",
"Description": "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created."
}

1
VERSION Normal file
View File

@ -0,0 +1 @@
4.3.2

View File

@ -528,6 +528,7 @@ static void ffmpeg_cleanup(int ret)
for (j = 0; j < fg->nb_outputs; j++) {
OutputFilter *ofilter = fg->outputs[j];
avfilter_inout_free(&ofilter->out_tmp);
av_freep(&ofilter->name);
av_freep(&ofilter->formats);
av_freep(&ofilter->channel_layouts);

View File

@ -118,7 +118,7 @@ end:
int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
int i=0;
ThreadContext *c;
AVCodecContext *thread_avctx = NULL;
if( !(avctx->thread_type & FF_THREAD_FRAME)
|| !(avctx->codec->capabilities & AV_CODEC_CAP_FRAME_THREADS))
@ -196,16 +196,17 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
AVDictionary *tmp = NULL;
int ret;
void *tmpv;
AVCodecContext *thread_avctx = avcodec_alloc_context3(avctx->codec);
thread_avctx = avcodec_alloc_context3(avctx->codec);
if(!thread_avctx)
goto fail;
tmpv = thread_avctx->priv_data;
*thread_avctx = *avctx;
thread_avctx->priv_data = tmpv;
thread_avctx->internal = NULL;
thread_avctx->hw_frames_ctx = NULL;
ret = av_opt_copy(thread_avctx, avctx);
if (ret < 0)
goto fail;
thread_avctx->priv_data = tmpv;
thread_avctx->internal = NULL;
if (avctx->codec->priv_class) {
int ret = av_opt_copy(thread_avctx->priv_data, avctx->priv_data);
if (ret < 0)
@ -234,6 +235,8 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
return 0;
fail:
avcodec_close(thread_avctx);
av_freep(&thread_avctx);
avctx->thread_count = i;
av_log(avctx, AV_LOG_ERROR, "ff_frame_thread_encoder_init failed\n");
ff_frame_thread_encoder_free(avctx);

View File

@ -23,6 +23,10 @@
#include "avcodec.h"
/**
* Initialize frame thread encoder.
* @note hardware encoders are not supported
*/
int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options);
void ff_frame_thread_encoder_free(AVCodecContext *avctx);
int ff_thread_video_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet_ptr);

View File

@ -1771,20 +1771,22 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
{
return get_audio_frame_duration(avctx->codec_id, avctx->sample_rate,
int duration = get_audio_frame_duration(avctx->codec_id, avctx->sample_rate,
avctx->channels, avctx->block_align,
avctx->codec_tag, avctx->bits_per_coded_sample,
avctx->bit_rate, avctx->extradata, avctx->frame_size,
frame_bytes);
return FFMAX(0, duration);
}
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
{
return get_audio_frame_duration(par->codec_id, par->sample_rate,
int duration = get_audio_frame_duration(par->codec_id, par->sample_rate,
par->channels, par->block_align,
par->codec_tag, par->bits_per_coded_sample,
par->bit_rate, par->extradata, par->frame_size,
frame_bytes);
return FFMAX(0, duration);
}
#if !HAVE_THREADS

View File

@ -329,6 +329,7 @@ static void v4l2_m2m_destroy_context(void *opaque, uint8_t *context)
sem_destroy(&s->refsync);
close(s->fd);
av_packet_unref(&s->buf_pkt);
av_free(s);
}
@ -338,6 +339,10 @@ int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv)
V4L2m2mContext *s = priv->context;
int ret;
if (!s)
return 0;
if (s->fd >= 0) {
ret = ff_v4l2_context_set_status(&s->output, VIDIOC_STREAMOFF);
if (ret)
av_log(s->avctx, AV_LOG_ERROR, "VIDIOC_STREAMOFF %s\n", s->output.name);
@ -345,6 +350,7 @@ int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv)
ret = ff_v4l2_context_set_status(&s->capture, VIDIOC_STREAMOFF);
if (ret)
av_log(s->avctx, AV_LOG_ERROR, "VIDIOC_STREAMOFF %s\n", s->capture.name);
}
ff_v4l2_context_release(&s->output);

View File

@ -212,9 +212,6 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx)
ret = ff_v4l2_m2m_codec_init(priv);
if (ret) {
av_log(avctx, AV_LOG_ERROR, "can't configure decoder\n");
s->self_ref = NULL;
av_buffer_unref(&priv->context_ref);
return ret;
}
@ -223,10 +220,7 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx)
static av_cold int v4l2_decode_close(AVCodecContext *avctx)
{
V4L2m2mPriv *priv = avctx->priv_data;
V4L2m2mContext *s = priv->context;
av_packet_unref(&s->buf_pkt);
return ff_v4l2_m2m_codec_end(priv);
return ff_v4l2_m2m_codec_end(avctx->priv_data);
}
#define OFFSET(x) offsetof(V4L2m2mPriv, x)
@ -261,7 +255,7 @@ static const AVOption options[] = {
.close = v4l2_decode_close, \
.bsfs = bsf_name, \
.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, \
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_CLEANUP, \
.wrapper_name = "v4l2m2m", \
}

View File

@ -416,6 +416,7 @@ static const AVCodecDefault v4l2_m2m_defaults[] = {
.close = v4l2_encode_close, \
.defaults = v4l2_m2m_defaults, \
.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, \
.wrapper_name = "v4l2m2m", \
}

View File

@ -238,6 +238,9 @@ int ff_vmafmotion_init(VMAFMotionData *s,
int i;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
if (w < 3 || h < 3)
return AVERROR(EINVAL);
s->width = w;
s->height = h;
s->stride = FFALIGN(w * sizeof(uint16_t), 32);

View File

@ -123,20 +123,22 @@ static void filter_edges(void *dst1, void *prev1, void *cur1, void *next1,
uint8_t *next2 = parity ? cur : next;
const int edge = MAX_ALIGN - 1;
int offset = FFMAX(w - edge, 3);
/* Only edge pixels need to be processed here. A constant value of false
* for is_not_edge should let the compiler ignore the whole branch. */
FILTER(0, 3, 0)
FILTER(0, FFMIN(3, w), 0)
dst = (uint8_t*)dst1 + w - edge;
prev = (uint8_t*)prev1 + w - edge;
cur = (uint8_t*)cur1 + w - edge;
next = (uint8_t*)next1 + w - edge;
dst = (uint8_t*)dst1 + offset;
prev = (uint8_t*)prev1 + offset;
cur = (uint8_t*)cur1 + offset;
next = (uint8_t*)next1 + offset;
prev2 = (uint8_t*)(parity ? prev : cur);
next2 = (uint8_t*)(parity ? cur : next);
FILTER(w - edge, w - 3, 1)
FILTER(w - 3, w, 0)
FILTER(offset, w - 3, 1)
offset = FFMAX(offset, w - 3);
FILTER(offset, w, 0)
}
@ -170,21 +172,23 @@ static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1,
uint16_t *next2 = parity ? cur : next;
const int edge = MAX_ALIGN / 2 - 1;
int offset = FFMAX(w - edge, 3);
mrefs /= 2;
prefs /= 2;
FILTER(0, 3, 0)
FILTER(0, FFMIN(3, w), 0)
dst = (uint16_t*)dst1 + w - edge;
prev = (uint16_t*)prev1 + w - edge;
cur = (uint16_t*)cur1 + w - edge;
next = (uint16_t*)next1 + w - edge;
dst = (uint16_t*)dst1 + offset;
prev = (uint16_t*)prev1 + offset;
cur = (uint16_t*)cur1 + offset;
next = (uint16_t*)next1 + offset;
prev2 = (uint16_t*)(parity ? prev : cur);
next2 = (uint16_t*)(parity ? cur : next);
FILTER(w - edge, w - 3, 1)
FILTER(w - 3, w, 0)
FILTER(offset, w - 3, 1)
offset = FFMAX(offset, w - 3);
FILTER(offset, w, 0)
}
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)

View File

@ -1224,7 +1224,7 @@ static void update_initial_durations(AVFormatContext *s, AVStream *st,
if (!st->internal->avctx->has_b_frames)
pktl->pkt.pts = cur_dts;
// if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO)
pktl->pkt.duration = duration;
pktl->pkt.duration = duration;
} else
break;
cur_dts = pktl->pkt.dts + pktl->pkt.duration;

View File

@ -1,6 +0,0 @@
/* Generated by ffmpeg configure */
#ifndef AVUTIL_AVCONFIG_H
#define AVUTIL_AVCONFIG_H
#define AV_HAVE_BIGENDIAN 0
#define AV_HAVE_FAST_UNALIGNED 1
#endif /* AVUTIL_AVCONFIG_H */

View File

@ -1,5 +0,0 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
#define FFMPEG_VERSION "4.3.1"
#endif /* AVUTIL_FFVERSION_H */