diff options
Diffstat (limited to 'gst-libs/ext')
-rw-r--r-- | gst-libs/ext/libav/Changelog | 13 | ||||
-rw-r--r-- | gst-libs/ext/libav/RELEASE | 2 | ||||
-rw-r--r-- | gst-libs/ext/libav/avconv.c | 27 | ||||
-rw-r--r-- | gst-libs/ext/libav/libavcodec/adpcmenc.c | 3 | ||||
-rw-r--r-- | gst-libs/ext/libav/libavcodec/avpacket.c | 1 | ||||
-rw-r--r-- | gst-libs/ext/libav/libavcodec/jpeg2000.c | 31 | ||||
-rw-r--r-- | gst-libs/ext/libav/libavcodec/libmp3lame.c | 8 | ||||
-rw-r--r-- | gst-libs/ext/libav/libavcodec/mpegaudiodecheader.c | 4 | ||||
-rw-r--r-- | gst-libs/ext/libav/libavcodec/ppc/asm.S | 8 | ||||
-rw-r--r-- | gst-libs/ext/libav/libavformat/mp3enc.c | 17 | ||||
-rw-r--r-- | gst-libs/ext/libav/libavformat/oggenc.c | 2 | ||||
-rw-r--r-- | gst-libs/ext/libav/libavutil/aarch64/asm.S | 4 | ||||
-rw-r--r-- | gst-libs/ext/libav/libavutil/lzo.c | 10 |
13 files changed, 96 insertions, 34 deletions
diff --git a/gst-libs/ext/libav/Changelog b/gst-libs/ext/libav/Changelog index 30e63c9..566de4b 100644 --- a/gst-libs/ext/libav/Changelog +++ b/gst-libs/ext/libav/Changelog @@ -1,6 +1,19 @@ Entries are sorted chronologically from oldest to youngest within each release, releases are sorted from youngest to oldest. +version 10.2: +- adpcm: Write the proper predictor in trellis mode in IMA QT +- adpcm: Avoid reading out of bounds in the IMA QT trellis encoder +- oggenc: Set the right AVOption size for the pref_duration option +- avpacket: fix copying side data in av_packet_copy_props() +- jpeg2000: fix dereferencing invalid pointers during cleanup +- Check mp3 header before calling avpriv_mpegaudio_decode_header() (bug/705) +- Check if an mp3 header is using a reserved sample rate +- lzo: Handle integer overflow (bug/704) +- avconv: make -shortest work with streamcopy +- ppc: Fix compilation for ppc64le (ELFv2) (ubuntu/1263802) +- aarch64: Use the correct syntax for relocations (debian/751856, ubuntu/1323144) + version 10.1: - pcm-dvd: Fix 20bit decoding (bug/592) - avi: Improve non-interleaved detection (bug/666) diff --git a/gst-libs/ext/libav/RELEASE b/gst-libs/ext/libav/RELEASE index ae425d6..e2498ea 100644 --- a/gst-libs/ext/libav/RELEASE +++ b/gst-libs/ext/libav/RELEASE @@ -1 +1 @@ -10.1 +10.2 diff --git a/gst-libs/ext/libav/avconv.c b/gst-libs/ext/libav/avconv.c index 64e8321..5a7c477 100644 --- a/gst-libs/ext/libav/avconv.c +++ b/gst-libs/ext/libav/avconv.c @@ -687,6 +687,19 @@ static int poll_filter(OutputStream *ost) return 0; } +static void finish_output_stream(OutputStream *ost) +{ + OutputFile *of = output_files[ost->file_index]; + int i; + + ost->finished = 1; + + if (of->shortest) { + for (i = 0; i < of->ctx->nb_streams; i++) + output_streams[of->ost_index + i]->finished = 1; + } +} + /* * Read as many frames from possible from lavfi and encode them. * @@ -697,7 +710,7 @@ static int poll_filter(OutputStream *ost) */ static int poll_filters(void) { - int i, j, ret = 0; + int i, ret = 0; while (ret >= 0 && !received_sigterm) { OutputStream *ost = NULL; @@ -724,15 +737,7 @@ static int poll_filters(void) ret = poll_filter(ost); if (ret == AVERROR_EOF) { - OutputFile *of = output_files[ost->file_index]; - - ost->finished = 1; - - if (of->shortest) { - for (j = 0; j < of->ctx->nb_streams; j++) - output_streams[of->ost_index + j]->finished = 1; - } - + finish_output_stream(ost); ret = 0; } else if (ret == AVERROR(EAGAIN)) return 0; @@ -2205,7 +2210,7 @@ static int process_input(void) if (ost->source_index == ifile->ist_index + i && (ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE)) - ost->finished= 1; + finish_output_stream(ost); } } diff --git a/gst-libs/ext/libav/libavcodec/adpcmenc.c b/gst-libs/ext/libav/libavcodec/adpcmenc.c index fb3ce0d..341dda4 100644 --- a/gst-libs/ext/libav/libavcodec/adpcmenc.c +++ b/gst-libs/ext/libav/libavcodec/adpcmenc.c @@ -549,10 +549,11 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, put_bits(&pb, 7, status->step_index); if (avctx->trellis > 0) { uint8_t buf[64]; - adpcm_compress_trellis(avctx, &samples_p[ch][1], buf, status, + adpcm_compress_trellis(avctx, &samples_p[ch][0], buf, status, 64, 1); for (i = 0; i < 64; i++) put_bits(&pb, 4, buf[i ^ 1]); + status->prev_sample = status->predictor; } else { for (i = 0; i < 64; i += 2) { int t1, t2; diff --git a/gst-libs/ext/libav/libavcodec/avpacket.c b/gst-libs/ext/libav/libavcodec/avpacket.c index c0a0f8c..052aaf8 100644 --- a/gst-libs/ext/libav/libavcodec/avpacket.c +++ b/gst-libs/ext/libav/libavcodec/avpacket.c @@ -325,7 +325,6 @@ int av_packet_copy_props(AVPacket *dst, const AVPacket *src) dst->convergence_duration = src->convergence_duration; dst->flags = src->flags; dst->stream_index = src->stream_index; - dst->side_data_elems = src->side_data_elems; for (i = 0; i < src->side_data_elems; i++) { enum AVPacketSideDataType type = src->side_data[i].type; diff --git a/gst-libs/ext/libav/libavcodec/jpeg2000.c b/gst-libs/ext/libav/libavcodec/jpeg2000.c index bf46398..154409e 100644 --- a/gst-libs/ext/libav/libavcodec/jpeg2000.c +++ b/gst-libs/ext/libav/libavcodec/jpeg2000.c @@ -228,7 +228,7 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp, if (!comp->i_data) return AVERROR(ENOMEM); } - comp->reslevel = av_malloc_array(codsty->nreslevels, sizeof(*comp->reslevel)); + comp->reslevel = av_mallocz_array(codsty->nreslevels, sizeof(*comp->reslevel)); if (!comp->reslevel) return AVERROR(ENOMEM); /* LOOP on resolution levels */ @@ -276,7 +276,7 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp, reslevel->log2_prec_height) - (reslevel->coord[1][0] >> reslevel->log2_prec_height); - reslevel->band = av_malloc_array(reslevel->nbands, sizeof(*reslevel->band)); + reslevel->band = av_mallocz_array(reslevel->nbands, sizeof(*reslevel->band)); if (!reslevel->band) return AVERROR(ENOMEM); @@ -372,9 +372,9 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp, for (j = 0; j < 2; j++) band->coord[1][j] = ff_jpeg2000_ceildiv(band->coord[1][j], dy); - band->prec = av_malloc_array(reslevel->num_precincts_x * - reslevel->num_precincts_y, - sizeof(*band->prec)); + band->prec = av_mallocz_array(reslevel->num_precincts_x * + reslevel->num_precincts_y, + sizeof(*band->prec)); if (!band->prec) return AVERROR(ENOMEM); @@ -487,15 +487,30 @@ void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty) for (reslevelno = 0; comp->reslevel && reslevelno < codsty->nreslevels; reslevelno++) { - Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno; + Jpeg2000ResLevel *reslevel; + + if (!comp->reslevel) + continue; + reslevel = comp->reslevel + reslevelno; for (bandno = 0; bandno < reslevel->nbands; bandno++) { - Jpeg2000Band *band = reslevel->band + bandno; + Jpeg2000Band *band; + + if (!reslevel->band) + continue; + + band = reslevel->band + bandno; for (precno = 0; precno < reslevel->num_precincts_x * reslevel->num_precincts_y; precno++) { - Jpeg2000Prec *prec = band->prec + precno; + Jpeg2000Prec *prec; + + if (!band->prec) + continue; + + prec = band->prec + precno; av_freep(&prec->zerobits); av_freep(&prec->cblkincl); av_freep(&prec->cblk); + } av_freep(&band->prec); diff --git a/gst-libs/ext/libav/libavcodec/libmp3lame.c b/gst-libs/ext/libav/libavcodec/libmp3lame.c index ee76ff8..2fc080f 100644 --- a/gst-libs/ext/libav/libavcodec/libmp3lame.c +++ b/gst-libs/ext/libav/libavcodec/libmp3lame.c @@ -175,6 +175,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, MPADecodeHeader hdr; int len, ret, ch; int lame_result; + uint32_t h; if (frame) { switch (avctx->sample_fmt) { @@ -230,7 +231,12 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, determine the frame size. */ if (s->buffer_index < 4) return 0; - if (avpriv_mpegaudio_decode_header(&hdr, AV_RB32(s->buffer))) { + h = AV_RB32(s->buffer); + if (ff_mpa_check_header(h) < 0) { + av_log(avctx, AV_LOG_ERROR, "Invalid mp3 header at start of buffer\n"); + return AVERROR_BUG; + } + if (avpriv_mpegaudio_decode_header(&hdr, h)) { av_log(avctx, AV_LOG_ERROR, "free format output not supported\n"); return -1; } diff --git a/gst-libs/ext/libav/libavcodec/mpegaudiodecheader.c b/gst-libs/ext/libav/libavcodec/mpegaudiodecheader.c index 69dda45..25e7319 100644 --- a/gst-libs/ext/libav/libavcodec/mpegaudiodecheader.c +++ b/gst-libs/ext/libav/libavcodec/mpegaudiodecheader.c @@ -24,6 +24,8 @@ * MPEG Audio header decoder. */ +#include "libavutil/common.h" + #include "avcodec.h" #include "mpegaudio.h" #include "mpegaudiodata.h" @@ -45,6 +47,8 @@ int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header) s->layer = 4 - ((header >> 17) & 3); /* extract frequency */ sample_rate_index = (header >> 10) & 3; + if (sample_rate_index >= FF_ARRAY_ELEMS(avpriv_mpa_freq_tab)) + sample_rate_index = 0; sample_rate = avpriv_mpa_freq_tab[sample_rate_index] >> (s->lsf + mpeg25); sample_rate_index += 3 * (s->lsf + mpeg25); s->sample_rate_index = sample_rate_index; diff --git a/gst-libs/ext/libav/libavcodec/ppc/asm.S b/gst-libs/ext/libav/libavcodec/ppc/asm.S index 4d4285b..141dee9 100644 --- a/gst-libs/ext/libav/libavcodec/ppc/asm.S +++ b/gst-libs/ext/libav/libavcodec/ppc/asm.S @@ -36,12 +36,20 @@ .macro extfunc name .global X(\name) +#if _CALL_ELF == 2 + .text +X(\name): + addis %r2, %r12, .TOC.-X(\name)@ha + addi %r2, %r2, .TOC.-X(\name)@l + .localentry X(\name), .-X(\name) +#else .section .opd, "aw" X(\name): .quad L(\name), .TOC.@tocbase, 0 .previous .type X(\name), STT_FUNC L(\name): +#endif .endm .macro movrel rd, sym, gp diff --git a/gst-libs/ext/libav/libavformat/mp3enc.c b/gst-libs/ext/libav/libavformat/mp3enc.c index 9326258..476d7f7 100644 --- a/gst-libs/ext/libav/libavformat/mp3enc.c +++ b/gst-libs/ext/libav/libavformat/mp3enc.c @@ -252,13 +252,16 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt) if (mp3->xing_offset && pkt->size >= 4) { MPADecodeHeader c; - - avpriv_mpegaudio_decode_header(&c, AV_RB32(pkt->data)); - - if (!mp3->initial_bitrate) - mp3->initial_bitrate = c.bit_rate; - if ((c.bit_rate == 0) || (mp3->initial_bitrate != c.bit_rate)) - mp3->has_variable_bitrate = 1; + uint32_t h; + + h = AV_RB32(pkt->data); + if (ff_mpa_check_header(h) == 0) { + avpriv_mpegaudio_decode_header(&c, h); + if (!mp3->initial_bitrate) + mp3->initial_bitrate = c.bit_rate; + if ((c.bit_rate == 0) || (mp3->initial_bitrate != c.bit_rate)) + mp3->has_variable_bitrate = 1; + } mp3_xing_add_frame(mp3, pkt); } diff --git a/gst-libs/ext/libav/libavformat/oggenc.c b/gst-libs/ext/libav/libavformat/oggenc.c index fd102c8..a03ac15 100644 --- a/gst-libs/ext/libav/libavformat/oggenc.c +++ b/gst-libs/ext/libav/libavformat/oggenc.c @@ -80,7 +80,7 @@ static const AVOption options[] = { { "pagesize", "preferred page size in bytes (deprecated)", OFFSET(pref_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, MAX_PAGE_SIZE, PARAM }, { "page_duration", "preferred page duration, in microseconds", - OFFSET(pref_duration), AV_OPT_TYPE_INT, { .i64 = 1000000 }, 0, INT64_MAX, PARAM }, + OFFSET(pref_duration), AV_OPT_TYPE_INT64, { .i64 = 1000000 }, 0, INT64_MAX, PARAM }, { NULL }, }; diff --git a/gst-libs/ext/libav/libavutil/aarch64/asm.S b/gst-libs/ext/libav/libavutil/aarch64/asm.S index 94e5a84..6608472 100644 --- a/gst-libs/ext/libav/libavutil/aarch64/asm.S +++ b/gst-libs/ext/libav/libavutil/aarch64/asm.S @@ -55,8 +55,8 @@ ELF .size \name, . - \name .macro movrel rd, val #if CONFIG_PIC - adrp \rd, #:pg_hi21:\val - add \rd, \rd, #:lo12:\val + adrp \rd, :pg_hi21:\val + add \rd, \rd, :lo12:\val #else ldr \rd, =\val #endif diff --git a/gst-libs/ext/libav/libavutil/lzo.c b/gst-libs/ext/libav/libavutil/lzo.c index 5c5ebc8..e458165 100644 --- a/gst-libs/ext/libav/libavutil/lzo.c +++ b/gst-libs/ext/libav/libavutil/lzo.c @@ -80,6 +80,10 @@ static inline void copy(LZOContext *c, int cnt) { register const uint8_t *src = c->in; register uint8_t *dst = c->out; + if (cnt < 0) { + c->error |= AV_LZO_ERROR; + return; + } if (cnt > c->in_end - src) { cnt = FFMAX(c->in_end - src, 0); c->error |= AV_LZO_INPUT_DEPLETED; @@ -103,7 +107,7 @@ static inline void copy(LZOContext *c, int cnt) /** * @brief Copies previously decoded bytes to current position. * @param back how many bytes back we start - * @param cnt number of bytes to copy, must be >= 0 + * @param cnt number of bytes to copy, must be > 0 * * cnt > back is valid, this will copy the bytes we just copied, * thus creating a repeating pattern with a period length of back. @@ -111,6 +115,10 @@ static inline void copy(LZOContext *c, int cnt) static inline void copy_backptr(LZOContext *c, int back, int cnt) { register uint8_t *dst = c->out; + if (cnt <= 0) { + c->error |= AV_LZO_ERROR; + return; + } if (dst - c->out_start < back) { c->error |= AV_LZO_INVALID_BACKPTR; return; |