Compare commits

..

1 Commits

Author SHA1 Message Date
Michael Niedermayer c5079bf3bc Bump minor versions after branching 4.3
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-08 22:49:04 +02:00
63 changed files with 134 additions and 303 deletions
+1 -1
View File
@@ -1 +1 @@
4.3
4.2.git
-15
View File
@@ -1,15 +0,0 @@
┌────────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 4.3 "4:3" │
└────────────────────────────────────┘
The FFmpeg Project proudly presents FFmpeg 4.3 "4:3", about 10
months after the release of FFmpeg 4.2.
A complete Changelog is available at the root of the project, and the
complete Git history on https://git.ffmpeg.org/gitweb/ffmpeg.git
We hope you will like this release as much as we enjoyed working on it, and
as usual, if you have any questions about it, or any FFmpeg related topic,
feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
on the mailing-lists.
+1 -1
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 4.3
PROJECT_NUMBER =
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
+1 -1
View File
@@ -317,7 +317,7 @@ list are dropped. You may use the special @code{*} string to match all pages,
or @code{subtitle} to match all subtitle pages.
Default value is *.
@item txt_default_region
Set default character set used for decoding, a value between 0 and 87 (see
Set default G0 character set used for decoding, a value between 0 and 80 (see
ETS 300 706, Section 15, Table 32). Default value is -1, which does not
override the libzvbi default. This option is needed for some legacy level 1.0
transmissions which cannot signal the proper charset.
+2 -2
View File
@@ -693,11 +693,11 @@ static int cbs_insert_unit(CodedBitstreamContext *ctx,
memmove(units + position + 1, units + position,
(frag->nb_units - position) * sizeof(*units));
} else {
units = av_malloc_array(frag->nb_units*2 + 1, sizeof(*units));
units = av_malloc_array(frag->nb_units + 1, sizeof(*units));
if (!units)
return AVERROR(ENOMEM);
frag->nb_units_allocated = 2*frag->nb_units_allocated + 1;
++frag->nb_units_allocated;
if (position > 0)
memcpy(units, frag->units, position * sizeof(*units));
+1 -2
View File
@@ -711,11 +711,10 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc)
#define infer(name, value) do { \
if (current->name != (value)) { \
av_log(ctx->log_ctx, AV_LOG_ERROR, \
av_log(ctx->log_ctx, AV_LOG_WARNING, "Warning: " \
"%s does not match inferred value: " \
"%"PRId64", but should be %"PRId64".\n", \
#name, (int64_t)current->name, (int64_t)(value)); \
return AVERROR_INVALIDDATA; \
} \
} while (0)
+1 -2
View File
@@ -408,11 +408,10 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc)
#define infer(name, value) do { \
if (current->name != (value)) { \
av_log(ctx->log_ctx, AV_LOG_ERROR, \
av_log(ctx->log_ctx, AV_LOG_WARNING, "Warning: " \
"%s does not match inferred value: " \
"%"PRId64", but should be %"PRId64".\n", \
#name, (int64_t)current->name, (int64_t)(value)); \
return AVERROR_INVALIDDATA; \
} \
} while (0)
+2 -2
View File
@@ -444,7 +444,7 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
if (r < 0)
return r;
pcm = (int16_t *)frame->data[0];
for (s = 0; s < duration; s++, ts+=(uint64_t)1) {
for (s = 0; s < duration; s++, ts++) {
memset(channels, 0, avc->channels * sizeof(*channels));
if (ts >= ws->next_ts)
wavesynth_enter_intervals(ws, ts);
@@ -452,7 +452,7 @@ static int wavesynth_decode(AVCodecContext *avc, void *rframe, int *rgot_frame,
for (c = 0; c < avc->channels; c++)
*(pcm++) = channels[c] >> 16;
}
ws->cur_ts += (uint64_t)duration;
ws->cur_ts += duration;
*rgot_frame = 1;
return packet->size;
}
+1 -5
View File
@@ -142,14 +142,10 @@ static int hevc_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out)
int nalu_type;
int is_irap, add_extradata, extra_size, prev_size;
if (bytestream2_get_bytes_left(&gb) < s->length_size) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
for (i = 0; i < s->length_size; i++)
nalu_size = (nalu_size << 8) | bytestream2_get_byte(&gb);
if (nalu_size < 2 || nalu_size > bytestream2_get_bytes_left(&gb)) {
if (nalu_size < 2) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
+1 -1
View File
@@ -723,7 +723,7 @@ static void decode_deep_rle32(uint8_t *dst, const uint8_t *src, int src_size, in
if (opcode >= 0) {
int size = opcode + 1;
for (i = 0; i < size; i++) {
int length = FFMIN(size - i, width - x);
int length = FFMIN(size - i, width);
if (src_end - src < length * 4)
return;
memcpy(dst + y*linesize + x * 4, src, length * 4);
+6 -13
View File
@@ -612,19 +612,12 @@ static int get_rgn(Jpeg2000DecoderContext *s, int n)
// Currently compno cannot be greater than 4.
// However, future implementation should support compno up to 65536
if (compno < s->ncomponents) {
int v;
if (s->curtileno == -1) {
v = bytestream2_get_byte(&s->g);
if (v > 30)
return AVERROR_PATCHWELCOME;
s->roi_shift[compno] = v;
} else {
if (s->curtileno == -1)
s->roi_shift[compno] = bytestream2_get_byte(&s->g);
else {
if (s->tile[s->curtileno].tp_idx != 0)
return AVERROR_INVALIDDATA; // marker occurs only in first tile part of tile
v = bytestream2_get_byte(&s->g);
if (v > 30)
return AVERROR_PATCHWELCOME;
s->tile[s->curtileno].comp[compno].roi_shift = v;
s->tile[s->curtileno].comp[compno].roi_shift = bytestream2_get_byte(&s->g);
}
return 0;
}
@@ -1676,8 +1669,8 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
ff_mqc_initdec(&t1->mqc, cblk->data, 0, 1);
while (passno--) {
if (bpno < 0 || bpno > 29) {
av_log(s->avctx, AV_LOG_ERROR, "bpno became invalid\n");
if (bpno < 0) {
av_log(s->avctx, AV_LOG_ERROR, "bpno became negative\n");
return AVERROR_INVALIDDATA;
}
switch(pass_t) {
+1 -1
View File
@@ -797,7 +797,7 @@ static void teletext_flush(AVCodecContext *avctx)
#define SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
{"txt_page", "page numbers to decode, subtitle for subtitles, * for all", OFFSET(pgno), AV_OPT_TYPE_STRING, {.str = "*"}, 0, 0, SD},
{"txt_default_region", "default G0 character set used for decoding", OFFSET(default_region), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 87, SD},
{"txt_default_region", "default G0 character set used for decoding", OFFSET(default_region), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 80, SD},
{"txt_chop_top", "discards the top teletext line", OFFSET(chop_top), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, SD},
{"txt_format", "format of the subtitles (bitmap or text or ass)", OFFSET(format_id), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 2, SD, "txt_format"},
{"bitmap", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0}, 0, 0, SD, "txt_format"},
+1 -1
View File
@@ -82,7 +82,7 @@ static inline void loco_update_rice_param(RICEContext *r, int val)
static inline int loco_get_rice(RICEContext *r)
{
unsigned v;
int v;
if (r->run > 0) { /* we have zero run */
r->run--;
loco_update_rice_param(r, 0);
+1 -1
View File
@@ -27,7 +27,7 @@ static int32_t scalarproduct_and_madd_int16_c(int16_t *v1, const int16_t *v2,
const int16_t *v3,
int order, int mul)
{
unsigned res = 0;
int res = 0;
do {
res += *v1 * *v2++;
+4 -4
View File
@@ -492,10 +492,10 @@ static int mov_text_init(AVCodecContext *avctx) {
return ff_ass_subtitle_header_full(avctx,
m->frame_width, m->frame_height,
m->d.font, m->d.fontsize,
(255U - m->d.alpha) << 24 | RGB_TO_BGR(m->d.color),
(255U - m->d.alpha) << 24 | RGB_TO_BGR(m->d.color),
(255U - m->d.back_alpha) << 24 | RGB_TO_BGR(m->d.back_color),
(255U - m->d.back_alpha) << 24 | RGB_TO_BGR(m->d.back_color),
(255 - m->d.alpha) << 24 | RGB_TO_BGR(m->d.color),
(255 - m->d.alpha) << 24 | RGB_TO_BGR(m->d.color),
(255 - m->d.back_alpha) << 24 | RGB_TO_BGR(m->d.back_color),
(255 - m->d.back_alpha) << 24 | RGB_TO_BGR(m->d.back_color),
m->d.bold, m->d.italic, m->d.underline,
ASS_DEFAULT_BORDERSTYLE, m->d.alignment);
} else
+3
View File
@@ -221,6 +221,7 @@ end:
}
/**
* Note: this function can read out of range and crash for corrupt streams.
* Changing this would eat up any speed benefits it has.
* Do not use "fast" flag if you need the code to be robust.
*/
@@ -396,6 +397,7 @@ end:
}
/**
* Note: this function can read out of range and crash for corrupt streams.
* Changing this would eat up any speed benefits it has.
* Do not use "fast" flag if you need the code to be robust.
*/
@@ -557,6 +559,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
}
/**
* Note: this function can read out of range and crash for corrupt streams.
* Changing this would eat up any speed benefits it has.
* Do not use "fast" flag if you need the code to be robust.
*/
+6 -15
View File
@@ -610,7 +610,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n)
dy -= 1 << (shift + a + 1);
else
dx -= 1 << (shift + a + 1);
mb_v = s->sprite_offset[0][n] + dx * s->mb_x * 16U + dy * s->mb_y * 16U;
mb_v = s->sprite_offset[0][n] + dx * s->mb_x * 16 + dy * s->mb_y * 16;
sum = 0;
for (y = 0; y < 16; y++) {
@@ -3134,7 +3134,6 @@ static int decode_studio_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
MpegEncContext *s = &ctx->m;
int width, height;
int bits_per_raw_sample;
int rgb, chroma_format;
// random_accessible_vol and video_object_type_indication have already
// been read by the caller decode_vol_header()
@@ -3142,36 +3141,28 @@ static int decode_studio_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
ctx->shape = get_bits(gb, 2); /* video_object_layer_shape */
skip_bits(gb, 4); /* video_object_layer_shape_extension */
skip_bits1(gb); /* progressive_sequence */
if (ctx->shape != RECT_SHAPE) {
avpriv_request_sample(s->avctx, "MPEG-4 Studio profile non rectangular shape");
return AVERROR_PATCHWELCOME;
}
if (ctx->shape != BIN_ONLY_SHAPE) {
rgb = get_bits1(gb); /* rgb_components */
chroma_format = get_bits(gb, 2); /* chroma_format */
if (!chroma_format || chroma_format == CHROMA_420 || (rgb && chroma_format == CHROMA_422)) {
ctx->rgb = get_bits1(gb); /* rgb_components */
s->chroma_format = get_bits(gb, 2); /* chroma_format */
if (!s->chroma_format) {
av_log(s->avctx, AV_LOG_ERROR, "illegal chroma format\n");
return AVERROR_INVALIDDATA;
}
bits_per_raw_sample = get_bits(gb, 4); /* bit_depth */
if (bits_per_raw_sample == 10) {
if (rgb) {
if (ctx->rgb) {
s->avctx->pix_fmt = AV_PIX_FMT_GBRP10;
}
else {
s->avctx->pix_fmt = chroma_format == CHROMA_422 ? AV_PIX_FMT_YUV422P10 : AV_PIX_FMT_YUV444P10;
s->avctx->pix_fmt = s->chroma_format == CHROMA_422 ? AV_PIX_FMT_YUV422P10 : AV_PIX_FMT_YUV444P10;
}
}
else {
avpriv_request_sample(s->avctx, "MPEG-4 Studio profile bit-depth %u", bits_per_raw_sample);
return AVERROR_PATCHWELCOME;
}
if (rgb != ctx->rgb || s->chroma_format != chroma_format)
s->context_reinit = 1;
s->avctx->bits_per_raw_sample = bits_per_raw_sample;
ctx->rgb = rgb;
s->chroma_format = chroma_format;
}
if (ctx->shape == RECT_SHAPE) {
check_marker(s->avctx, gb, "before video_object_layer_width");
-3
View File
@@ -410,9 +410,6 @@ static int decode_intra(AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame
int ret;
mgb = *gb;
if (get_bits_left(gb) < s->mode_size * 8)
return AVERROR_INVALIDDATA;
skip_bits_long(gb, s->mode_size * 8);
linesize[0] = frame->linesize[0];
+1 -1
View File
@@ -221,7 +221,7 @@ static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst,
length = 25 - nbits;
while (i < size) {
if (((state >> 8) + 3) & 0xFFFFFFF)
if (state >> 8 != -3)
value = ff_clz((state >> 8) + 3) ^ 0x1F;
else
value = -1;
+1 -5
View File
@@ -310,6 +310,7 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
}
if (for_user) {
dst->delay = src->thread_count - 1;
#if FF_API_CODED_FRAME
FF_DISABLE_DEPRECATION_WARNINGS
dst->coded_frame = src->coded_frame;
@@ -789,9 +790,6 @@ int ff_frame_thread_init(AVCodecContext *avctx)
fctx->async_lock = 1;
fctx->delaying = 1;
if (codec->type == AVMEDIA_TYPE_VIDEO)
avctx->delay = src->thread_count - 1;
for (i = 0; i < thread_count; i++) {
AVCodecContext *copy = av_malloc(sizeof(AVCodecContext));
PerThreadContext *p = &fctx->threads[i];
@@ -829,8 +827,6 @@ int ff_frame_thread_init(AVCodecContext *avctx)
copy->internal->thread_ctx = p;
copy->internal->last_pkt_props = &p->avpkt;
copy->delay = avctx->delay;
if (codec->priv_data_size) {
copy->priv_data = av_mallocz(codec->priv_data_size);
if (!copy->priv_data) {
+2 -2
View File
@@ -117,7 +117,7 @@ static av_always_inline void predict_slice_buffered(SnowContext *s, slice_buffer
static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, slice_buffer * sb, int start_y, int h, int save_state[1]){
const int w= b->width;
int y;
const int qlog= av_clip(s->qlog + (int64_t)b->qlog, 0, QROOT*16);
const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
int new_index = 0;
@@ -224,7 +224,7 @@ static int decode_q_branch(SnowContext *s, int level, int x, int y){
static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, IDWTELEM *src, int stride, int start_y, int end_y){
const int w= b->width;
const int qlog= av_clip(s->qlog + (int64_t)b->qlog, 0, QROOT*16);
const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);
const int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;
int x,y;
+1 -12
View File
@@ -1625,22 +1625,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s->lambda = 0;
}//else keep previous frame's qlog until after motion estimation
#if FF_API_CODED_FRAME
FF_DISABLE_DEPRECATION_WARNINGS
av_frame_unref(avctx->coded_frame);
FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (s->current_picture->data[0]) {
int w = s->avctx->width;
int h = s->avctx->height;
#if FF_API_CODED_FRAME
ret = av_frame_make_writable(s->current_picture);
if (ret < 0)
return ret;
#endif
s->mpvencdsp.draw_edges(s->current_picture->data[0],
s->current_picture->linesize[0], w , h ,
EDGE_WIDTH , EDGE_WIDTH , EDGE_TOP | EDGE_BOTTOM);
@@ -1658,6 +1646,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
ff_snow_frame_start(s);
#if FF_API_CODED_FRAME
FF_DISABLE_DEPRECATION_WARNINGS
av_frame_unref(avctx->coded_frame);
ret = av_frame_ref(avctx->coded_frame, s->current_picture);
FF_ENABLE_DEPRECATION_WARNINGS
#endif
+3 -4
View File
@@ -140,8 +140,7 @@ static inline av_flatten int get_symbol(RangeCoder *c, uint8_t *state, int is_si
if(get_rac(c, state+0))
return 0;
else{
int i, e;
unsigned a;
int i, e, a;
e= 0;
while(get_rac(c, state+1 + FFMIN(e,9))){ //1..10
e++;
@@ -475,7 +474,7 @@ static int predictor_calc_error(int *k, int *state, int order, int error)
for (i = order-2; i >= 0; i--, k_ptr--, state_ptr--)
{
int k_value = *k_ptr, state_value = *state_ptr;
x -= shift_down(k_value * (unsigned)state_value, LATTICE_SHIFT);
x -= shift_down(k_value * state_value, LATTICE_SHIFT);
state_ptr[1] = state_value + shift_down(k_value * (unsigned)x, LATTICE_SHIFT);
}
#else
@@ -1045,7 +1044,7 @@ static int sonic_decode_frame(AVCodecContext *avctx,
x += s->channels;
}
s->int_samples[x] = predictor_calc_error(s->predictor_k, s->predictor_state[ch], s->num_taps, s->coded_samples[ch][i] * (unsigned)quant);
s->int_samples[x] = predictor_calc_error(s->predictor_k, s->predictor_state[ch], s->num_taps, s->coded_samples[ch][i] * quant);
x += s->channels;
}
-3
View File
@@ -679,9 +679,6 @@ static int tiff_unpack_strip(TiffContext *s, AVFrame *p, uint8_t *dst, int strid
return 0;
}
if (is_dng && stride == 0)
return AVERROR_INVALIDDATA;
for (line = 0; line < lines; line++) {
if (src - ssrc > size) {
av_log(s->avctx, AV_LOG_ERROR, "Source data overread\n");
+1 -1
View File
@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 91
#define LIBAVCODEC_VERSION_MINOR 92
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
+1 -1
View File
@@ -184,7 +184,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
unsigned int channel_mask;
int i, log2_max_num_subframes;
if (avctx->block_align <= 0 || avctx->block_align > (1<<21)) {
if (avctx->block_align <= 0) {
av_log(avctx, AV_LOG_ERROR, "block_align is not set or invalid\n");
return AVERROR(EINVAL);
}
+1 -1
View File
@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVDEVICE_VERSION_MAJOR 58
#define LIBAVDEVICE_VERSION_MINOR 10
#define LIBAVDEVICE_VERSION_MINOR 11
#define LIBAVDEVICE_VERSION_MICRO 100
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
+1 -1
View File
@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 7
#define LIBAVFILTER_VERSION_MINOR 85
#define LIBAVFILTER_VERSION_MINOR 86
#define LIBAVFILTER_VERSION_MICRO 100
-3
View File
@@ -218,7 +218,6 @@ static int fourxm_read_header(AVFormatContext *s)
fourxm->track_count = 0;
fourxm->tracks = NULL;
fourxm->fps = (AVRational){1,1};
fourxm->video_stream_index = -1;
/* skip the first 3 32-bit numbers */
avio_skip(pb, 12);
@@ -327,8 +326,6 @@ static int fourxm_read_packet(AVFormatContext *s,
* and size */
if (size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - 8)
return AVERROR_INVALIDDATA;
if (fourxm->video_stream_index < 0)
return AVERROR_INVALIDDATA;
if ((ret = av_new_packet(pkt, size + 8)) < 0)
return ret;
pkt->stream_index = fourxm->video_stream_index;
+7 -19
View File
@@ -83,8 +83,6 @@ typedef struct APEContext {
uint8_t *bittable;
} APEContext;
static int ape_read_close(AVFormatContext * s);
static int ape_probe(const AVProbeData * p)
{
int version = AV_RL16(p->buf+4);
@@ -283,18 +281,14 @@ static int ape_read_header(AVFormatContext * s)
if (ape->seektablelength > 0) {
ape->seektable = av_mallocz(ape->seektablelength);
if (!ape->seektable) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (!ape->seektable)
return AVERROR(ENOMEM);
for (i = 0; i < ape->seektablelength / sizeof(uint32_t) && !pb->eof_reached; i++)
ape->seektable[i] = avio_rl32(pb);
if (ape->fileversion < 3810) {
ape->bittable = av_mallocz(ape->totalframes);
if (!ape->bittable) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (!ape->bittable)
return AVERROR(ENOMEM);
for (i = 0; i < ape->totalframes && !pb->eof_reached; i++)
ape->bittable[i] = avio_r8(pb);
}
@@ -347,10 +341,8 @@ static int ape_read_header(AVFormatContext * s)
/* now we are ready: build format streams */
st = avformat_new_stream(s, NULL);
if (!st) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (!st)
return AVERROR(ENOMEM);
total_blocks = (ape->totalframes == 0) ? 0 : ((ape->totalframes - 1) * ape->blocksperframe) + ape->finalframeblocks;
@@ -367,7 +359,7 @@ static int ape_read_header(AVFormatContext * s)
avpriv_set_pts_info(st, 64, 1, ape->samplerate);
if ((ret = ff_alloc_extradata(st->codecpar, APE_EXTRADATA_SIZE)) < 0)
goto fail;
return ret;
AV_WL16(st->codecpar->extradata + 0, ape->fileversion);
AV_WL16(st->codecpar->extradata + 2, ape->compressiontype);
AV_WL16(st->codecpar->extradata + 4, ape->formatflags);
@@ -386,10 +378,6 @@ static int ape_read_header(AVFormatContext * s)
}
return 0;
fail:
ape_read_close(s);
return ret;
}
static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
+2 -5
View File
@@ -81,11 +81,11 @@ static int aqt_read_header(AVFormatContext *s)
if (!new_event) {
sub = ff_subtitles_queue_insert(&aqt->q, "\n", 1, 1);
if (!sub)
goto fail;
return AVERROR(ENOMEM);
}
sub = ff_subtitles_queue_insert(&aqt->q, line, strlen(line), !new_event);
if (!sub)
goto fail;
return AVERROR(ENOMEM);
if (new_event) {
sub->pts = frame;
sub->duration = -1;
@@ -97,9 +97,6 @@ static int aqt_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(s, &aqt->q);
return 0;
fail:
ff_subtitles_queue_clean(&aqt->q);
return AVERROR(ENOMEM);
}
static int aqt_read_packet(AVFormatContext *s, AVPacket *pkt)
-2
View File
@@ -160,8 +160,6 @@ static int ass_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(s, &ass->q);
end:
if (res < 0)
ass_read_close(s);
av_bprint_finalize(&header, NULL);
av_bprint_finalize(&line, NULL);
av_bprint_finalize(&rline, NULL);
+2 -30
View File
@@ -311,8 +311,6 @@ static struct playlist *new_playlist(HLSContext *c, const char *url,
return NULL;
reset_packet(&pls->pkt);
ff_make_absolute_url(pls->url, sizeof(pls->url), base, url);
if (!pls->url[0])
return NULL;
pls->seek_timestamp = AV_NOPTS_VALUE;
pls->is_id3_timestamped = -1;
@@ -418,10 +416,6 @@ static struct segment *new_init_section(struct playlist *pls,
ptr = info->uri;
} else {
ff_make_absolute_url(tmp_str, sizeof(tmp_str), url_base, info->uri);
if (!tmp_str[0]) {
av_free(sec);
return NULL;
}
}
sec->url = av_strdup(ptr);
if (!sec->url) {
@@ -847,11 +841,6 @@ static int parse_playlist(HLSContext *c, const char *url,
if (key_type != KEY_NONE) {
ff_make_absolute_url(tmp_str, sizeof(tmp_str), url, key);
if (!tmp_str[0]) {
av_free(cur_init_section);
ret = AVERROR_INVALIDDATA;
goto fail;
}
cur_init_section->key = av_strdup(tmp_str);
if (!cur_init_section->key) {
av_free(cur_init_section);
@@ -894,6 +883,8 @@ static int parse_playlist(HLSContext *c, const char *url,
ret = AVERROR(ENOMEM);
goto fail;
}
seg->duration = duration;
seg->key_type = key_type;
if (has_iv) {
memcpy(seg->iv, iv, sizeof(iv));
} else {
@@ -904,11 +895,6 @@ static int parse_playlist(HLSContext *c, const char *url,
if (key_type != KEY_NONE) {
ff_make_absolute_url(tmp_str, sizeof(tmp_str), url, key);
if (!tmp_str[0]) {
ret = AVERROR_INVALIDDATA;
av_free(seg);
goto fail;
}
seg->key = av_strdup(tmp_str);
if (!seg->key) {
av_free(seg);
@@ -920,13 +906,6 @@ static int parse_playlist(HLSContext *c, const char *url,
}
ff_make_absolute_url(tmp_str, sizeof(tmp_str), url, line);
if (!tmp_str[0]) {
ret = AVERROR_INVALIDDATA;
if (seg->key)
av_free(seg->key);
av_free(seg);
goto fail;
}
seg->url = av_strdup(tmp_str);
if (!seg->url) {
av_free(seg->key);
@@ -935,13 +914,6 @@ static int parse_playlist(HLSContext *c, const char *url,
goto fail;
}
if (duration < 0.001 * AV_TIME_BASE) {
av_log(c->ctx, AV_LOG_WARNING, "Cannot get correct #EXTINF value of segment %s,"
" set to default value to 1ms.\n", seg->url);
duration = 0.001 * AV_TIME_BASE;
}
seg->duration = duration;
seg->key_type = key_type;
dynarray_add(&pls->segments, &pls->n_segments, seg);
is_segment = 0;
+1 -1
View File
@@ -1993,7 +1993,7 @@ static int parse_variant_stream_mapstring(AVFormatContext *s)
return AVERROR(EINVAL);
}
num = strtoll(val, &end, 10);
num = strtoll(val, &end, 0);
if (!av_isdigit(*val) || *end != '\0') {
av_log(s, AV_LOG_ERROR, "Invalid stream number: '%s'\n", val);
return AVERROR(EINVAL);
+2 -4
View File
@@ -188,10 +188,8 @@ static int jacosub_read_header(AVFormatContext *s)
AVPacket *sub;
sub = ff_subtitles_queue_insert(&jacosub->q, line, len, merge_line);
if (!sub) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (!sub)
return AVERROR(ENOMEM);
sub->pos = pos;
merge_line = len > 1 && !strcmp(&line[len - 2], "\\\n");
continue;
-1
View File
@@ -202,7 +202,6 @@ static int lrc_read_header(AVFormatContext *s)
sub = ff_subtitles_queue_insert(&lrc->q, line.str + ts_strlength,
line.len - ts_strlength, 0);
if(!sub) {
ff_subtitles_queue_clean(&lrc->q);
return AVERROR(ENOMEM);
}
sub->pos = pos;
+10 -16
View File
@@ -2938,8 +2938,9 @@ static int matroska_read_header(AVFormatContext *s)
st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
av_init_packet(pkt);
pkt->buf = attachments[j].bin.buf;
attachments[j].bin.buf = NULL;
pkt->buf = av_buffer_ref(attachments[j].bin.buf);
if (!pkt->buf)
return AVERROR(ENOMEM);
pkt->data = attachments[j].bin.data;
pkt->size = attachments[j].bin.size;
pkt->stream_index = st->index;
@@ -3568,8 +3569,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf
if (st->discard >= AVDISCARD_ALL)
return res;
if (block_duration > INT64_MAX)
block_duration = INT64_MAX;
av_assert1(block_duration != AV_NOPTS_VALUE);
block_time = sign_extend(AV_RB16(data), 16);
data += 2;
@@ -4180,18 +4180,15 @@ static int webm_dash_manifest_read_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "Failed to read file headers\n");
return -1;
}
if (!matroska->tracks.nb_elem || !s->nb_streams) {
av_log(s, AV_LOG_ERROR, "No track found\n");
ret = AVERROR_INVALIDDATA;
goto fail;
if (!s->nb_streams) {
matroska_read_close(s);
av_log(s, AV_LOG_ERROR, "No streams found\n");
return AVERROR_INVALIDDATA;
}
if (!matroska->is_live) {
buf = av_asprintf("%g", matroska->duration);
if (!buf) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (!buf) return AVERROR(ENOMEM);
av_dict_set(&s->streams[0]->metadata, DURATION,
buf, AV_DICT_DONT_STRDUP_VAL);
@@ -4214,7 +4211,7 @@ static int webm_dash_manifest_read_header(AVFormatContext *s)
ret = webm_dash_manifest_cues(s, init_range);
if (ret < 0) {
av_log(s, AV_LOG_ERROR, "Error parsing Cues\n");
goto fail;
return ret;
}
}
@@ -4224,9 +4221,6 @@ static int webm_dash_manifest_read_header(AVFormatContext *s)
matroska->bandwidth, 0);
}
return 0;
fail:
matroska_read_close(s);
return ret;
}
static int webm_dash_manifest_read_packet(AVFormatContext *s, AVPacket *pkt)
+1 -3
View File
@@ -2118,19 +2118,17 @@ static int mkv_write_vtt_blocks(AVFormatContext *s, AVIOContext *pb, const AVPac
mkv_track *track = &mkv->tracks[pkt->stream_index];
ebml_master blockgroup;
int id_size, settings_size, size;
const char *id, *settings;
uint8_t *id, *settings;
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 : "";
size = id_size + 1 + settings_size + 1 + pkt->size;
+5 -10
View File
@@ -81,7 +81,7 @@ static int microdvd_read_header(AVFormatContext *s)
AVRational pts_info = (AVRational){ 2997, 125 }; /* default: 23.976 fps */
MicroDVDContext *microdvd = s->priv_data;
AVStream *st = avformat_new_stream(s, NULL);
int i = 0, ret;
int i = 0;
char line_buf[MAX_LINESIZE];
int has_real_fps = 0;
@@ -117,10 +117,10 @@ static int microdvd_read_header(AVFormatContext *s)
continue;
}
if (!st->codecpar->extradata && sscanf(line, "{DEFAULT}{}%c", &c) == 1) {
int size = strlen(line + 11);
int ret, size = strlen(line + 11);
ret = ff_alloc_extradata(st->codecpar, size);
if (ret < 0)
goto fail;
return ret;
memcpy(st->codecpar->extradata, line + 11, size);
continue;
}
@@ -138,10 +138,8 @@ static int microdvd_read_header(AVFormatContext *s)
if (!*p)
continue;
sub = ff_subtitles_queue_insert(&microdvd->q, p, strlen(p), 0);
if (!sub) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (!sub)
return AVERROR(ENOMEM);
sub->pos = pos;
sub->pts = get_pts(line);
sub->duration = get_duration(line);
@@ -158,9 +156,6 @@ static int microdvd_read_header(AVFormatContext *s)
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codecpar->codec_id = AV_CODEC_ID_MICRODVD;
return 0;
fail:
ff_subtitles_queue_clean(&microdvd->q);
return ret;
}
static int microdvd_read_packet(AVFormatContext *s, AVPacket *pkt)
+18 -22
View File
@@ -2342,7 +2342,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
uint32_t format = AV_RB32(st->codecpar->extradata + 22);
if (format == AV_RB32("name") && (int64_t)size >= (int64_t)len + 18) {
uint16_t str_size = AV_RB16(st->codecpar->extradata + 26); /* string length */
if (str_size > 0 && size >= (int)str_size + 30) {
if (str_size > 0 && size >= (int)str_size + 26) {
char *reel_name = av_malloc(str_size + 1);
if (!reel_name)
return AVERROR(ENOMEM);
@@ -4434,9 +4434,6 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom)
} else
break;
if (*p)
break;
*p = av_malloc(len + 1);
if (!*p) {
ret = AVERROR(ENOMEM);
@@ -7583,13 +7580,14 @@ static int mov_read_header(AVFormatContext *s)
avio_seek(pb, 0, SEEK_SET);
if ((err = mov_read_default(mov, pb, atom)) < 0) {
av_log(s, AV_LOG_ERROR, "error reading header\n");
goto fail;
mov_read_close(s);
return err;
}
} while ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !mov->found_moov && !mov->moov_retry++);
if (!mov->found_moov) {
av_log(s, AV_LOG_ERROR, "moov atom not found\n");
err = AVERROR_INVALIDDATA;
goto fail;
mov_read_close(s);
return AVERROR_INVALIDDATA;
}
av_log(mov->fc, AV_LOG_TRACE, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb));
@@ -7642,7 +7640,7 @@ static int mov_read_header(AVFormatContext *s)
}
if (st->codecpar->codec_id == AV_CODEC_ID_DVD_SUBTITLE) {
if ((err = mov_rewrite_dvd_sub_extradata(st)) < 0)
goto fail;
return err;
}
}
if (mov->handbrake_version &&
@@ -7662,8 +7660,8 @@ static int mov_read_header(AVFormatContext *s)
if (sc->data_size > INT64_MAX / sc->time_scale / 8) {
av_log(s, AV_LOG_ERROR, "Overflow during bit rate calculation %"PRId64" * 8 * %d\n",
sc->data_size, sc->time_scale);
err = AVERROR_INVALIDDATA;
goto fail;
mov_read_close(s);
return AVERROR_INVALIDDATA;
}
st->codecpar->bit_rate = sc->data_size * 8 * sc->time_scale / st->duration;
}
@@ -7678,8 +7676,8 @@ static int mov_read_header(AVFormatContext *s)
if (sc->data_size > INT64_MAX / sc->time_scale / 8) {
av_log(s, AV_LOG_ERROR, "Overflow during bit rate calculation %"PRId64" * 8 * %d\n",
sc->data_size, sc->time_scale);
err = AVERROR_INVALIDDATA;
goto fail;
mov_read_close(s);
return AVERROR_INVALIDDATA;
}
st->codecpar->bit_rate = sc->data_size * 8 * sc->time_scale /
sc->duration_for_fps;
@@ -7703,7 +7701,8 @@ static int mov_read_header(AVFormatContext *s)
case AVMEDIA_TYPE_AUDIO:
err = ff_replaygain_export(st, s->metadata);
if (err < 0) {
goto fail;
mov_read_close(s);
return err;
}
break;
case AVMEDIA_TYPE_VIDEO:
@@ -7711,7 +7710,7 @@ static int mov_read_header(AVFormatContext *s)
err = av_stream_add_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, (uint8_t*)sc->display_matrix,
sizeof(int32_t) * 9);
if (err < 0)
goto fail;
return err;
sc->display_matrix = NULL;
}
@@ -7720,7 +7719,7 @@ static int mov_read_header(AVFormatContext *s)
(uint8_t *)sc->stereo3d,
sizeof(*sc->stereo3d));
if (err < 0)
goto fail;
return err;
sc->stereo3d = NULL;
}
@@ -7729,7 +7728,7 @@ static int mov_read_header(AVFormatContext *s)
(uint8_t *)sc->spherical,
sc->spherical_size);
if (err < 0)
goto fail;
return err;
sc->spherical = NULL;
}
@@ -7738,7 +7737,7 @@ static int mov_read_header(AVFormatContext *s)
(uint8_t *)sc->mastering,
sizeof(*sc->mastering));
if (err < 0)
goto fail;
return err;
sc->mastering = NULL;
}
@@ -7747,7 +7746,7 @@ static int mov_read_header(AVFormatContext *s)
(uint8_t *)sc->coll,
sc->coll_size);
if (err < 0)
goto fail;
return err;
sc->coll = NULL;
}
@@ -7761,9 +7760,6 @@ static int mov_read_header(AVFormatContext *s)
mov->frag_index.item[i].headers_read = 1;
return 0;
fail:
mov_read_close(s);
return err;
}
static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)
@@ -7780,7 +7776,7 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)
av_log(s, AV_LOG_TRACE, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
if (!sample || (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL) && current_sample->pos < sample->pos) ||
((s->pb->seekable & AVIO_SEEKABLE_NORMAL) &&
((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb && dts != AV_NOPTS_VALUE &&
((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&
((FFABS(best_dts - dts) <= AV_TIME_BASE && current_sample->pos < sample->pos) ||
(FFABS(best_dts - dts) > AV_TIME_BASE && dts < best_dts)))))) {
sample = current_sample;
+4 -9
View File
@@ -55,7 +55,7 @@ static int mpl2_probe(const AVProbeData *p)
return AVPROBE_SCORE_MAX;
}
static int read_ts(char **line, int64_t *pts_start, int64_t *duration)
static int read_ts(char **line, int64_t *pts_start, int *duration)
{
char c;
int len;
@@ -69,10 +69,7 @@ static int read_ts(char **line, int64_t *pts_start, int64_t *duration)
}
if (sscanf(*line, "[%"SCNd64"][%"SCNd64"]%c%n",
pts_start, &end, &c, &len) >= 3) {
if (end < *pts_start || end - (uint64_t)*pts_start > INT64_MAX) {
*duration = -1;
} else
*duration = end - *pts_start;
*duration = end - *pts_start;
*line += len - 1;
return 0;
}
@@ -100,7 +97,7 @@ static int mpl2_read_header(AVFormatContext *s)
const int64_t pos = avio_tell(s->pb);
int len = ff_get_line(s->pb, line, sizeof(line));
int64_t pts_start;
int64_t duration;
int duration;
if (!len)
break;
@@ -111,10 +108,8 @@ static int mpl2_read_header(AVFormatContext *s)
AVPacket *sub;
sub = ff_subtitles_queue_insert(&mpl2->q, p, strlen(p), 0);
if (!sub) {
ff_subtitles_queue_clean(&mpl2->q);
if (!sub)
return AVERROR(ENOMEM);
}
sub->pos = pos;
sub->pts = pts_start;
sub->duration = duration;
+2 -4
View File
@@ -154,10 +154,8 @@ static int mpsub_read_header(AVFormatContext *s)
}
st = avformat_new_stream(s, NULL);
if (!st) {
res = AVERROR(ENOMEM);
goto end;
}
if (!st)
return AVERROR(ENOMEM);
avpriv_set_pts_info(st, 64, pts_info.den, pts_info.num);
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codecpar->codec_id = AV_CODEC_ID_TEXT;
-1
View File
@@ -867,7 +867,6 @@ static inline int mxf_read_utf16_string(AVIOContext *pb, int size, char** str, i
return AVERROR(EINVAL);
buf_size = size + size / 2 + 1;
av_free(*str);
*str = av_malloc(buf_size);
if (!*str)
return AVERROR(ENOMEM);
+2 -3
View File
@@ -226,10 +226,9 @@ static int ogg_replace_stream(AVFormatContext *s, uint32_t serial, char *magic,
return AVERROR_INVALIDDATA;
}
/* We only have a single stream anyway, so if there's a new stream with
* a different codec just replace it */
os = &ogg->streams[0];
if (os->codec != codec)
return AVERROR(EINVAL);
os->serial = serial;
os->codec = codec;
os->serial = serial;
+15 -27
View File
@@ -79,13 +79,6 @@ typedef struct OMAContext {
int (*read_packet)(AVFormatContext *s, AVPacket *pkt);
} OMAContext;
static int oma_read_close(AVFormatContext *s)
{
OMAContext *oc = s->priv_data;
av_freep(&oc->av_des);
return 0;
}
static void hex_log(AVFormatContext *s, int level,
const char *name, const uint8_t *value, int len)
{
@@ -409,14 +402,11 @@ static int oma_read_header(AVFormatContext *s)
}
ret = avio_read(s->pb, buf, EA3_HEADER_SIZE);
if (ret < EA3_HEADER_SIZE) {
ff_id3v2_free_extra_meta(&extra_meta);
if (ret < EA3_HEADER_SIZE)
return -1;
}
if (memcmp(buf, ((const uint8_t[]){'E', 'A', '3'}), 3) ||
buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
ff_id3v2_free_extra_meta(&extra_meta);
av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n");
return AVERROR_INVALIDDATA;
}
@@ -435,10 +425,8 @@ static int oma_read_header(AVFormatContext *s)
codec_params = AV_RB24(&buf[33]);
st = avformat_new_stream(s, NULL);
if (!st) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (!st)
return AVERROR(ENOMEM);
st->start_time = 0;
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
@@ -453,8 +441,7 @@ static int oma_read_header(AVFormatContext *s)
samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100;
if (!samplerate) {
av_log(s, AV_LOG_ERROR, "Unsupported sample rate\n");
ret = AVERROR_INVALIDDATA;
goto fail;
return AVERROR_INVALIDDATA;
}
if (samplerate != 44100)
avpriv_request_sample(s, "Sample rate %d", samplerate);
@@ -472,7 +459,7 @@ static int oma_read_header(AVFormatContext *s)
/* fake the ATRAC3 extradata
* (wav format, makes stream copy to wav work) */
if ((ret = ff_alloc_extradata(st->codecpar, 14)) < 0)
goto fail;
return ret;
edata = st->codecpar->extradata;
AV_WL16(&edata[0], 1); // always 1
@@ -489,8 +476,7 @@ static int oma_read_header(AVFormatContext *s)
if (!channel_id) {
av_log(s, AV_LOG_ERROR,
"Invalid ATRAC-X channel id: %"PRIu32"\n", channel_id);
ret = AVERROR_INVALIDDATA;
goto fail;
return AVERROR_INVALIDDATA;
}
st->codecpar->channel_layout = ff_oma_chid_to_native_layout[channel_id - 1];
st->codecpar->channels = ff_oma_chid_to_num_channels[channel_id - 1];
@@ -498,8 +484,7 @@ static int oma_read_header(AVFormatContext *s)
samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100;
if (!samplerate) {
av_log(s, AV_LOG_ERROR, "Unsupported sample rate\n");
ret = AVERROR_INVALIDDATA;
goto fail;
return AVERROR_INVALIDDATA;
}
st->codecpar->sample_rate = samplerate;
st->codecpar->bit_rate = samplerate * framesize / (2048 / 8);
@@ -539,16 +524,12 @@ static int oma_read_header(AVFormatContext *s)
break;
default:
av_log(s, AV_LOG_ERROR, "Unsupported codec %d!\n", buf[32]);
ret = AVERROR(ENOSYS);
goto fail;
return AVERROR(ENOSYS);
}
st->codecpar->block_align = framesize;
return 0;
fail:
oma_read_close(s);
return ret;
}
static int oma_read_packet(AVFormatContext *s, AVPacket *pkt)
@@ -610,6 +591,13 @@ wipe:
return err;
}
static int oma_read_close(AVFormatContext *s)
{
OMAContext *oc = s->priv_data;
av_free(oc->av_des);
return 0;
}
AVInputFormat ff_oma_demuxer = {
.name = "oma",
.long_name = NULL_IF_CONFIG_SMALL("Sony OpenMG audio"),
+1 -3
View File
@@ -94,10 +94,8 @@ static int pjs_read_header(AVFormatContext *s)
p[strcspn(p, "\"")] = 0;
sub = ff_subtitles_queue_insert(&pjs->q, p, strlen(p), 0);
if (!sub) {
ff_subtitles_queue_clean(&pjs->q);
if (!sub)
return AVERROR(ENOMEM);
}
sub->pos = pos;
sub->pts = pts_start;
sub->duration = duration;
+4 -2
View File
@@ -387,7 +387,7 @@ static int prompeg_write(URLContext *h, const uint8_t *buf, int size) {
PrompegFec *fec_tmp;
uint8_t *bitstring = NULL;
int col_idx, col_out_idx, row_idx;
int ret = 0;
int ret, written = 0;
if (s->init && ((ret = prompeg_init(h, buf, size)) < 0))
goto end;
@@ -403,6 +403,7 @@ static int prompeg_write(URLContext *h, const uint8_t *buf, int size) {
if (!s->first || s->packet_idx > 0) {
if ((ret = prompeg_write_fec(h, s->fec_row, PROMPEG_FEC_ROW)) < 0)
goto end;
written += ret;
}
memcpy(s->fec_row->bitstring, bitstring, s->bitstring_size);
s->fec_row->sn = AV_RB16(buf + 2);
@@ -433,6 +434,7 @@ static int prompeg_write(URLContext *h, const uint8_t *buf, int size) {
col_out_idx = s->packet_idx / s->d;
if ((ret = prompeg_write_fec(h, s->fec_col[col_out_idx], PROMPEG_FEC_COL)) < 0)
goto end;
written += ret;
}
if (++s->packet_idx >= s->packet_idx_max) {
@@ -441,7 +443,7 @@ static int prompeg_write(URLContext *h, const uint8_t *buf, int size) {
s->first = 0;
}
ret = size;
ret = written;
end:
av_free(bitstring);
-2
View File
@@ -108,8 +108,6 @@ static int sami_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(s, &sami->q);
end:
if (res < 0)
ff_subtitles_queue_clean(&sami->q);
av_bprint_finalize(&buf, NULL);
return res;
}
+1 -4
View File
@@ -136,7 +136,7 @@ try_again:
sub = ff_subtitles_queue_insert(&scc->q, out, i, 0);
if (!sub)
goto fail;
return AVERROR(ENOMEM);
sub->pos = current_pos;
sub->pts = ts_start;
@@ -155,9 +155,6 @@ try_again:
ff_subtitles_queue_finalize(s, &scc->q);
return ret;
fail:
ff_subtitles_queue_clean(&scc->q);
return AVERROR(ENOMEM);
}
static int scc_read_packet(AVFormatContext *s, AVPacket *pkt)
-2
View File
@@ -207,8 +207,6 @@ static int srt_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(s, &srt->q);
end:
if (res < 0)
ff_subtitles_queue_clean(&srt->q);
av_bprint_finalize(&buf, NULL);
return res;
}
+1 -3
View File
@@ -97,10 +97,8 @@ static int stl_read_header(AVFormatContext *s)
if (pts_start != AV_NOPTS_VALUE) {
AVPacket *sub;
sub = ff_subtitles_queue_insert(&stl->q, p, strlen(p), 0);
if (!sub) {
ff_subtitles_queue_clean(&stl->q);
if (!sub)
return AVERROR(ENOMEM);
}
sub->pos = pos;
sub->pts = pts_start;
sub->duration = duration;
+1 -3
View File
@@ -77,10 +77,8 @@ static int subviewer1_read_header(AVFormatContext *s)
sub->duration = pts_start - sub->pts;
} else {
sub = ff_subtitles_queue_insert(&subviewer1->q, line, len, 0);
if (!sub) {
ff_subtitles_queue_clean(&subviewer1->q);
if (!sub)
return AVERROR(ENOMEM);
}
sub->pos = pos;
sub->pts = pts_start;
sub->duration = -1;
-2
View File
@@ -172,8 +172,6 @@ static int subviewer_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(s, &subviewer->q);
end:
if (res < 0)
ff_subtitles_queue_clean(&subviewer->q);
av_bprint_finalize(&header, NULL);
return res;
}
+4 -4
View File
@@ -275,13 +275,10 @@ static int parse_file(AVIOContext *pb, FFDemuxSubtitlesQueue *subs)
static av_cold int tedcaptions_read_header(AVFormatContext *avf)
{
TEDCaptionsDemuxer *tc = avf->priv_data;
AVStream *st = avformat_new_stream(avf, NULL);
AVStream *st;
int ret, i;
AVPacket *last;
if (!st)
return AVERROR(ENOMEM);
ret = parse_file(avf->pb, &tc->subs);
if (ret < 0) {
if (ret == AVERROR_INVALIDDATA)
@@ -295,6 +292,9 @@ static av_cold int tedcaptions_read_header(AVFormatContext *avf)
tc->subs.subs[i].pts += tc->start_time;
last = &tc->subs.subs[tc->subs.nb_subs - 1];
st = avformat_new_stream(avf, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codecpar->codec_id = AV_CODEC_ID_TEXT;
avpriv_set_pts_info(st, 64, 1, 1000);
-2
View File
@@ -75,8 +75,6 @@ static int thp_read_header(AVFormatContext *s)
avio_rb32(pb); /* Max samples. */
thp->fps = av_d2q(av_int2float(avio_rb32(pb)), INT_MAX);
if (thp->fps.den <= 0 || thp->fps.num < 0)
return AVERROR_INVALIDDATA;
thp->framecnt = avio_rb32(pb);
thp->first_framesz = avio_rb32(pb);
pb->maxsize = avio_rb32(pb);
-5
View File
@@ -90,8 +90,6 @@ static void trim_double_dot_url(char *buf, const char *rel, int size)
if (p && (sep = strstr(p, "://"))) {
sep += 3;
root = strchr(sep, '/');
if (!root)
return;
}
/* set new current position if the root node is changed */
@@ -152,7 +150,6 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
}
/* If rel actually is an absolute url, just copy it */
if (!base || strstr(rel, "://") || rel[0] == '/') {
memset(buf, 0, size);
trim_double_dot_url(buf, rel, size);
return;
}
@@ -180,8 +177,6 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
if (sep) {
sep += 3;
root = strchr(sep, '/');
if (!root)
return;
}
}
+1 -1
View File
@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MINOR 45
#define LIBAVFORMAT_VERSION_MINOR 46
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
+1 -3
View File
@@ -83,10 +83,8 @@ static int vplayer_read_header(AVFormatContext *s)
AVPacket *sub;
sub = ff_subtitles_queue_insert(&vplayer->q, p, strlen(p), 0);
if (!sub) {
ff_subtitles_queue_clean(&vplayer->q);
if (!sub)
return AVERROR(ENOMEM);
}
sub->pos = pos;
sub->pts = pts_start;
sub->duration = -1;
-2
View File
@@ -164,8 +164,6 @@ static int webvtt_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(s, &webvtt->q);
end:
if (res < 0)
ff_subtitles_queue_clean(&webvtt->q);
av_bprint_finalize(&cue, NULL);
return res;
}
+1 -1
View File
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 56
#define LIBAVUTIL_VERSION_MINOR 51
#define LIBAVUTIL_VERSION_MINOR 52
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
+1 -1
View File
@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBPOSTPROC_VERSION_MAJOR 55
#define LIBPOSTPROC_VERSION_MINOR 7
#define LIBPOSTPROC_VERSION_MINOR 8
#define LIBPOSTPROC_VERSION_MICRO 100
#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
+1 -1
View File
@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBSWRESAMPLE_VERSION_MAJOR 3
#define LIBSWRESAMPLE_VERSION_MINOR 7
#define LIBSWRESAMPLE_VERSION_MINOR 8
#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
+1 -1
View File
@@ -27,7 +27,7 @@
#include "libavutil/version.h"
#define LIBSWSCALE_VERSION_MAJOR 5
#define LIBSWSCALE_VERSION_MINOR 7
#define LIBSWSCALE_VERSION_MINOR 8
#define LIBSWSCALE_VERSION_MICRO 100
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \