diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c index 5c0a9de8f6..66055b79aa 100644 --- a/libavcodec/audiotoolboxdec.c +++ b/libavcodec/audiotoolboxdec.c @@ -483,7 +483,7 @@ static int ffat_decode(AVCodecContext *avctx, void *data, if (avctx->codec_id == AV_CODEC_ID_AAC) { if (!at->extradata_size) { uint8_t *side_data; - int side_data_size = 0; + int side_data_size; side_data = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, &side_data_size); diff --git a/libavcodec/decode.c b/libavcodec/decode.c index a4e50c0d03..de9c079f9d 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -66,7 +66,7 @@ typedef struct FramePool { static int apply_param_change(AVCodecContext *avctx, const AVPacket *avpkt) { - int size = 0, ret; + int size, ret; const uint8_t *data; uint32_t flags; int64_t val; diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index 1063c546b0..eddcea8941 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -220,7 +220,7 @@ static int vpx_decode(AVCodecContext *avctx, struct vpx_image *img, *img_alpha; int ret; uint8_t *side_data = NULL; - int side_data_size = 0; + int side_data_size; ret = decode_frame(avctx, &ctx->decoder, avpkt->data, avpkt->size); if (ret) diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index d937e2bea9..9e285752eb 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -169,7 +169,7 @@ static int adts_write_packet(AVFormatContext *s, AVPacket *pkt) return 0; if (!par->extradata_size) { uint8_t *side_data; - int side_data_size = 0, ret; + int side_data_size, ret; side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_data_size); diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c index 88cd8054d6..7ad6a923d5 100644 --- a/libavformat/apngenc.c +++ b/libavformat/apngenc.c @@ -119,7 +119,7 @@ static int flush_packet(AVFormatContext *format_context, AVPacket *packet) AVIOContext *io_context = format_context->pb; AVStream *codec_stream = format_context->streams[0]; uint8_t *side_data = NULL; - int side_data_size = 0; + int side_data_size; av_assert0(apng->prev_packet); diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 5cf3ce8a1a..1cfcdc6392 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -902,7 +902,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) if (par->codec_id == AV_CODEC_ID_AAC || par->codec_id == AV_CODEC_ID_H264 || par->codec_id == AV_CODEC_ID_MPEG4) { - int side_size = 0; + int side_size; uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size); if (side && side_size > 0 && (side_size != par->extradata_size || memcmp(side, par->extradata, side_size))) { ret = ff_alloc_extradata(par, side_size); diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c index 5ae677f5da..72b7f72f22 100644 --- a/libavformat/latmenc.c +++ b/libavformat/latmenc.c @@ -165,7 +165,7 @@ static int latm_write_packet(AVFormatContext *s, AVPacket *pkt) return ff_raw_write_packet(s, pkt); else { uint8_t *side_data; - int side_data_size = 0, ret; + int side_data_size, ret; side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_data_size); diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index eaed02bc92..105ed5197e 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -2007,7 +2007,7 @@ static int mkv_write_block(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar; mkv_track *track = &mkv->tracks[pkt->stream_index]; uint8_t *data = NULL, *side_data = NULL; - int err = 0, offset = 0, size = pkt->size, side_data_size = 0; + int err = 0, offset = 0, size = pkt->size, side_data_size; int64_t ts = track->write_dts ? pkt->dts : pkt->pts; uint64_t additional_id; int64_t discard_padding = 0; @@ -2122,12 +2122,10 @@ static int mkv_write_vtt_blocks(AVFormatContext *s, AVIOContext *pb, const AVPac int64_t ts = track->write_dts ? pkt->dts : pkt->pts; const int flags = 0; - id_size = 0; id = av_packet_get_side_data(pkt, AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size); id = id ? id : ""; - settings_size = 0; settings = av_packet_get_side_data(pkt, AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size); settings = settings ? settings : ""; @@ -2184,7 +2182,7 @@ static int mkv_check_new_extra_data(AVFormatContext *s, const AVPacket *pkt) mkv_track *track = &mkv->tracks[pkt->stream_index]; AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar; uint8_t *side_data; - int side_data_size = 0, ret; + int side_data_size, ret; side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_data_size); diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 6eeac8efa6..b8e45760ee 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -5788,7 +5788,7 @@ static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt) trk->par->codec_id == AV_CODEC_ID_AAC || trk->par->codec_id == AV_CODEC_ID_AV1 || trk->par->codec_id == AV_CODEC_ID_FLAC) { - int side_size = 0; + int side_size; uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size); if (side && side_size > 0 && (side_size != par->extradata_size || memcmp(side, par->extradata, side_size))) { void *newextra = av_mallocz(side_size + AV_INPUT_BUFFER_PADDING_SIZE); diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index 14d4b6e0af..a3586e1f86 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -354,7 +354,7 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt) if (mp3->xing_offset) { uint8_t *side_data = NULL; - int side_data_size = 0; + int side_data_size; mp3_xing_add_frame(mp3, pkt); mp3->audio_size += pkt->size; diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index 63047beccc..9ef7e9094d 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -589,7 +589,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) break; case AV_CODEC_ID_H263: if (s->flags & FF_RTP_FLAG_RFC2190) { - int mb_info_size = 0; + int mb_info_size; const uint8_t *mb_info = av_packet_get_side_data(pkt, AV_PKT_DATA_H263_MB_INFO, &mb_info_size); diff --git a/libavformat/segment.c b/libavformat/segment.c index 2ff2b5372e..f67456fa57 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -873,7 +873,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR(EINVAL); if (!st->codecpar->extradata_size) { - int pkt_extradata_size = 0; + int pkt_extradata_size; uint8_t *pkt_extradata = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &pkt_extradata_size); if (pkt_extradata && pkt_extradata_size > 0) { ret = ff_alloc_extradata(st->codecpar, pkt_extradata_size);