diff options
author | Michael Niedermayer <[email protected]> | 2013-05-12 12:49:36 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2013-05-12 12:49:36 +0200 |
commit | 065996b9843b6366bab23d0c6adc61c05c0f9f75 (patch) | |
tree | a14a67fa5ddf00dbf4a100298f54abf3b7dc67de | |
parent | 1ace588f4a94fa607a42971b59483447647c4727 (diff) | |
parent | 05015d03da1d745bb92915b5cea92dec16af719f (diff) |
Merge commit '05015d03da1d745bb92915b5cea92dec16af719f' into release/1.1
* commit '05015d03da1d745bb92915b5cea92dec16af719f':
matroska: fix a corner case in ebml-lace parsing
avfiltergraph: check for sws opts being non-NULL before using them.
configure: Enable hwaccels without external dependencies by default.
oma: Validate sample rates
Conflicts:
libavfilter/avfiltergraph.c
libavfilter/graphparser.c
libavformat/oma.c
Merged-by: Michael Niedermayer <[email protected]>
-rwxr-xr-x | configure | 3 | ||||
-rw-r--r-- | libavfilter/avfiltergraph.c | 11 | ||||
-rw-r--r-- | libavfilter/graphparser.c | 4 | ||||
-rw-r--r-- | libavformat/matroskadec.c | 2 | ||||
-rw-r--r-- | libavformat/oma.c | 2 | ||||
-rw-r--r-- | libavformat/omadec.c | 17 |
6 files changed, 26 insertions, 13 deletions
@@ -2100,6 +2100,9 @@ enable safe_bitstream_reader enable static enable swscale_alpha +# By default, enable only those hwaccels that have no external dependencies. +enable dxva2 vdpau + # build settings SHFLAGS='-shared -Wl,-soname,$$(@F)' FFSERVERLDFLAGS=-Wl,-E diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index c05bbb7fe6..471a8e6779 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -24,6 +24,7 @@ #include <string.h> #include "libavutil/avassert.h" +#include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" @@ -373,11 +374,11 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d", scaler_count++); - if (graph->scale_sws_opts) - snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts); - else - snprintf(scale_args, sizeof(scale_args), "0:0"); - + av_strlcpy(scale_args, "0:0", sizeof(scale_args)); + if (graph->scale_sws_opts) { + av_strlcat(scale_args, ":", sizeof(scale_args)); + av_strlcat(scale_args, graph->scale_sws_opts, sizeof(scale_args)); + } if ((ret = avfilter_graph_create_filter(&convert, filter, inst_name, scale_args, NULL, graph)) < 0) diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index 0ce823a10d..453e962a7e 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -123,8 +123,8 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind return ret; } - if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") - && ctx->scale_sws_opts) { + if (!strcmp(filt_name, "scale") && args && !strstr(args, "flags") && + ctx->scale_sws_opts) { snprintf(tmp_args, sizeof(tmp_args), "%s:%s", args, ctx->scale_sws_opts); args = tmp_args; diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index ea7c541d16..23ab29ecfc 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1958,7 +1958,7 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf, case 0x3: /* EBML lacing */ { uint64_t num; - uint32_t total; + uint64_t total; n = matroska_ebmlnum_uint(matroska, data, size, &num); if (n < 0) { av_log(matroska->ctx, AV_LOG_INFO, diff --git a/libavformat/oma.c b/libavformat/oma.c index 9e4bfbdd77..fc926bf8ba 100644 --- a/libavformat/oma.c +++ b/libavformat/oma.c @@ -22,7 +22,7 @@ #include "oma.h" #include "libavcodec/avcodec.h" -const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0, 0, 0}; +const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 }; const AVCodecTag ff_oma_codec_tags[] = { { AV_CODEC_ID_ATRAC3, OMA_CODECID_ATRAC3 }, diff --git a/libavformat/omadec.c b/libavformat/omadec.c index 8d29675c1c..46d13ffbf1 100644 --- a/libavformat/omadec.c +++ b/libavformat/omadec.c @@ -309,7 +309,11 @@ static int oma_read_header(AVFormatContext *s) switch (buf[32]) { case OMA_CODECID_ATRAC3: - samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7]*100; + samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100; + if (!samplerate) { + av_log(s, AV_LOG_ERROR, "Unsupported sample rate\n"); + return AVERROR_INVALIDDATA; + } if (samplerate != 44100) av_log_ask_for_sample(s, "Unsupported sample rate: %d\n", samplerate); @@ -340,9 +344,14 @@ static int oma_read_header(AVFormatContext *s) case OMA_CODECID_ATRAC3P: st->codec->channels = (codec_params >> 10) & 7; framesize = ((codec_params & 0x3FF) * 8) + 8; - st->codec->sample_rate = ff_oma_srate_tab[(codec_params >> 13) & 7]*100; - st->codec->bit_rate = st->codec->sample_rate * framesize * 8 / 1024; - avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate); + samplerate = ff_oma_srate_tab[(codec_params >> 13) & 7] * 100; + if (!samplerate) { + av_log(s, AV_LOG_ERROR, "Unsupported sample rate\n"); + return AVERROR_INVALIDDATA; + } + st->codec->sample_rate = samplerate; + st->codec->bit_rate = samplerate * framesize * 8 / 1024; + avpriv_set_pts_info(st, 64, 1, samplerate); av_log(s, AV_LOG_ERROR, "Unsupported codec ATRAC3+!\n"); break; case OMA_CODECID_MP3: |