Compare commits
35 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
60eebbbf22 | ||
![]() |
5eca7ba16b | ||
![]() |
69e191f854 | ||
![]() |
3fa6ecca76 | ||
![]() |
d7c0287fbd | ||
![]() |
7bcf142c02 | ||
![]() |
0251cd6cf3 | ||
![]() |
dde76f2d04 | ||
![]() |
e46999ccf4 | ||
![]() |
58ea532cad | ||
![]() |
0ec1ffcb4d | ||
![]() |
2df2c0aab0 | ||
![]() |
65bb07d4be | ||
![]() |
3fc75e79cf | ||
![]() |
30463a0c99 | ||
![]() |
7ee0b1937a | ||
![]() |
dd957b56e6 | ||
![]() |
9f30eafd0f | ||
![]() |
22e20a1d83 | ||
![]() |
dee25a5fa5 | ||
![]() |
0f956cde93 | ||
![]() |
9631209eea | ||
![]() |
93c675d6a6 | ||
![]() |
262192a48b | ||
![]() |
b515a23f76 | ||
![]() |
d1fc87529f | ||
![]() |
873a0dfa26 | ||
![]() |
f2fd5b9eb2 | ||
![]() |
cdedd71a7e | ||
![]() |
a90a7594a8 | ||
![]() |
641a010157 | ||
![]() |
b6fb6ccda4 | ||
![]() |
3b535bbf88 | ||
![]() |
bf44699314 | ||
![]() |
1a65265131 |
36
Changelog
36
Changelog
@@ -1,6 +1,42 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 2.5.11
|
||||
- MAINTAINERS: remove unmaintained releases
|
||||
- avcodec/jpeg2000dec: More completely check cdef
|
||||
- avutil/opt: check for and handle errors in av_opt_set_dict2()
|
||||
- avcodec/flacenc: fix calculation of bits required in case of custom sample rate
|
||||
- avformat: Document urls a bit
|
||||
- avformat/libquvi: Set default demuxer and protocol limitations
|
||||
- avformat/concat: Check protocol prefix
|
||||
- doc/demuxers: Document enable_drefs and use_absolute_path
|
||||
- avcodec/mjpegdec: Check for end for both bytes in unescaping
|
||||
- avcodec/mpegvideo_enc: Check for integer overflow in ff_mpv_reallocate_putbitbuffer()
|
||||
- avformat/avformat: Replace some references to filenames by urls
|
||||
- avcodec/wmaenc: Check ff_wma_init() for failure
|
||||
- avcodec/mpeg12enc: Move high resolution thread check to before initializing threads
|
||||
- avformat/avio: Limit url option parsing to the documented cases
|
||||
- avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()
|
||||
- mov: Add an option to toggle dref opening
|
||||
- avcodec/gif: Fix lzw buffer size
|
||||
- avcodec/put_bits: Assert buf_ptr in flush_put_bits()
|
||||
- avcodec/tiff: Check subsample & rps values more completely
|
||||
- swscale/swscale: Add some sanity checks for srcSlice* parameters
|
||||
- swscale/x86/rgb2rgb_template: Fix planar2x() for short width
|
||||
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_yv12_wrapper()
|
||||
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_rgb24_wrapper()
|
||||
- avcodec/aacenc: Check both channels for finiteness
|
||||
- swscale/swscale-test: Fix slice height in random reference data creation.
|
||||
- dca: fix misaligned access in avpriv_dca_convert_bitstream
|
||||
- brstm: fix missing closing brace
|
||||
- brstm: also allocate b->table in read_packet
|
||||
- brstm: make sure an ADPC chunk was read for adpcm_thp
|
||||
- vorbisdec: reject rangebits 0 with non-0 partitions
|
||||
- vorbisdec: reject channel mapping with less than two channels
|
||||
- ffmdec: reset packet_end in case of failure
|
||||
- avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
|
||||
- avcodec/samidec: make sure to properly restore parsing context after a tag
|
||||
|
||||
version 2.5.10
|
||||
- configure: bump copyright year to 2016
|
||||
- avformat/hls: Even stricter URL checks
|
||||
|
@@ -537,9 +537,6 @@ Releases
|
||||
========
|
||||
|
||||
2.5 Michael Niedermayer
|
||||
2.4 Michael Niedermayer
|
||||
2.2 Michael Niedermayer
|
||||
1.2 Michael Niedermayer
|
||||
|
||||
If you want to maintain an older release, please contact us
|
||||
|
||||
|
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 2.5.10
|
||||
PROJECT_NUMBER = 2.5.11
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
@@ -359,6 +359,23 @@ ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section mov/mp4/3gp/Quicktme
|
||||
|
||||
Quicktime / MP4 demuxer.
|
||||
|
||||
This demuxer accepts the following options:
|
||||
@table @option
|
||||
@item enable_drefs
|
||||
Enable loading of external tracks, disabled by default.
|
||||
Enabling this can theoretically leak information in some use cases.
|
||||
|
||||
@item use_absolute_path
|
||||
Allows loading of external tracks via absolute paths, disabled by default.
|
||||
Enabling this poses a security risk. It should only be enabled if the source
|
||||
is known to be non malicious.
|
||||
|
||||
@end table
|
||||
|
||||
@section mpegts
|
||||
|
||||
MPEG-2 transport stream demuxer.
|
||||
|
@@ -567,8 +567,16 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
ics->group_len[w] = wi[ch].grouping[w];
|
||||
|
||||
apply_window_and_mdct(s, &cpe->ch[ch], overlap);
|
||||
if (isnan(cpe->ch->coeffs[0])) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains NaN\n");
|
||||
|
||||
if (isnan(cpe->ch[ch].coeffs[ 0]) || isinf(cpe->ch[ch].coeffs[ 0]) ||
|
||||
isnan(cpe->ch[ch].coeffs[ 128]) || isinf(cpe->ch[ch].coeffs[ 128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[2*128]) || isinf(cpe->ch[ch].coeffs[2*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[3*128]) || isinf(cpe->ch[ch].coeffs[3*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[4*128]) || isinf(cpe->ch[ch].coeffs[4*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[5*128]) || isinf(cpe->ch[ch].coeffs[5*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[6*128]) || isinf(cpe->ch[ch].coeffs[6*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[7*128]) || isinf(cpe->ch[ch].coeffs[7*128])) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains NaN/+-Inf\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
|
@@ -523,7 +523,7 @@ ASSStyle *ff_ass_style_get(ASSSplitContext *ctx, const char *style)
|
||||
if (!style || !*style)
|
||||
style = "Default";
|
||||
for (i=0; i<ass->styles_count; i++)
|
||||
if (!strcmp(ass->styles[i].name, style))
|
||||
if (ass->styles[i].name && !strcmp(ass->styles[i].name, style))
|
||||
return ass->styles + i;
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -40,8 +40,6 @@ int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
|
||||
{
|
||||
uint32_t mrk;
|
||||
int i, tmp;
|
||||
const uint16_t *ssrc = (const uint16_t *) src;
|
||||
uint16_t *sdst = (uint16_t *) dst;
|
||||
PutBitContext pb;
|
||||
|
||||
if ((unsigned) src_size > (unsigned) max_size)
|
||||
@@ -53,8 +51,11 @@ int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
|
||||
memcpy(dst, src, src_size);
|
||||
return src_size;
|
||||
case DCA_MARKER_RAW_LE:
|
||||
for (i = 0; i < (src_size + 1) >> 1; i++)
|
||||
*sdst++ = av_bswap16(*ssrc++);
|
||||
for (i = 0; i < (src_size + 1) >> 1; i++) {
|
||||
AV_WB16(dst, AV_RL16(src));
|
||||
src += 2;
|
||||
dst += 2;
|
||||
}
|
||||
return src_size;
|
||||
case DCA_MARKER_14B_BE:
|
||||
case DCA_MARKER_14B_LE:
|
||||
|
@@ -916,7 +916,7 @@ static int count_frame_header(FlacEncodeContext *s)
|
||||
count += 16;
|
||||
|
||||
/* explicit sample rate */
|
||||
count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12)) * 8;
|
||||
count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12) * 2) * 8;
|
||||
|
||||
/* frame header CRC-8 */
|
||||
count += 8;
|
||||
|
@@ -43,6 +43,7 @@ typedef struct {
|
||||
const AVClass *class;
|
||||
LZWState *lzw;
|
||||
uint8_t *buf;
|
||||
int buf_size;
|
||||
AVFrame *last_frame;
|
||||
int flags;
|
||||
uint32_t palette[AVPALETTE_COUNT]; ///< local reference palette for !pal8
|
||||
@@ -168,7 +169,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
|
||||
|
||||
bytestream_put_byte(bytestream, 0x08);
|
||||
|
||||
ff_lzw_encode_init(s->lzw, s->buf, 2 * width * height,
|
||||
ff_lzw_encode_init(s->lzw, s->buf, s->buf_size,
|
||||
12, FF_LZW_GIF, put_bits);
|
||||
|
||||
ptr = buf + y_start*linesize + x_start;
|
||||
@@ -224,7 +225,8 @@ static av_cold int gif_encode_init(AVCodecContext *avctx)
|
||||
avctx->coded_frame->key_frame = 1;
|
||||
|
||||
s->lzw = av_mallocz(ff_lzw_encode_state_size);
|
||||
s->buf = av_malloc(avctx->width*avctx->height*2);
|
||||
s->buf_size = avctx->width*avctx->height*2 + 1000;
|
||||
s->buf = av_malloc(s->buf_size);
|
||||
s->tmpl = av_malloc(avctx->width);
|
||||
if (!s->tmpl || !s->buf || !s->lzw)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -283,6 +285,7 @@ static int gif_encode_close(AVCodecContext *avctx)
|
||||
|
||||
av_freep(&s->lzw);
|
||||
av_freep(&s->buf);
|
||||
s->buf_size = 0;
|
||||
av_frame_free(&s->last_frame);
|
||||
av_freep(&s->tmpl);
|
||||
return 0;
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avcodec.h"
|
||||
#include "bytestream.h"
|
||||
#include "hpeldsp.h"
|
||||
@@ -949,7 +950,7 @@ static void ipvideo_decode_opcodes(IpvideoContext *s, AVFrame *frame)
|
||||
}
|
||||
}
|
||||
if (bytestream2_get_bytes_left(&s->stream_ptr) > 1) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
av_log(s->avctx, AV_LOG_DEBUG,
|
||||
"decode finished with %d bytes left over\n",
|
||||
bytestream2_get_bytes_left(&s->stream_ptr));
|
||||
}
|
||||
@@ -987,12 +988,15 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
AVFrame *frame = data;
|
||||
int ret;
|
||||
|
||||
if (buf_size < 2)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
/* decoding map contains 4 bits of information per 8x8 block */
|
||||
s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2);
|
||||
s->decoding_map_size = AV_RL16(avpkt->data);
|
||||
|
||||
/* compressed buffer needs to be large enough to at least hold an entire
|
||||
* decoding map */
|
||||
if (buf_size < s->decoding_map_size)
|
||||
if (buf_size < s->decoding_map_size + 2)
|
||||
return buf_size;
|
||||
|
||||
if (av_packet_get_side_data(avpkt, AV_PKT_DATA_PARAM_CHANGE, NULL)) {
|
||||
@@ -1000,8 +1004,8 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
|
||||
av_frame_unref(s->second_last_frame);
|
||||
}
|
||||
|
||||
s->decoding_map = buf;
|
||||
bytestream2_init(&s->stream_ptr, buf + s->decoding_map_size,
|
||||
s->decoding_map = buf + 2;
|
||||
bytestream2_init(&s->stream_ptr, buf + 2 + s->decoding_map_size,
|
||||
buf_size - s->decoding_map_size);
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
|
||||
|
@@ -1245,11 +1245,15 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
|
||||
if (tile->codsty[0].mct)
|
||||
mct_decode(s, tile);
|
||||
|
||||
if (s->cdef[0] < 0) {
|
||||
for (x = 0; x < s->ncomponents; x++)
|
||||
s->cdef[x] = x + 1;
|
||||
if ((s->ncomponents & 1) == 0)
|
||||
s->cdef[s->ncomponents-1] = 0;
|
||||
for (x = 0; x < s->ncomponents; x++) {
|
||||
if (s->cdef[x] < 0) {
|
||||
for (x = 0; x < s->ncomponents; x++) {
|
||||
s->cdef[x] = x + 1;
|
||||
}
|
||||
if ((s->ncomponents & 1) == 0)
|
||||
s->cdef[s->ncomponents-1] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (s->precision <= 8) {
|
||||
|
@@ -1942,7 +1942,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
|
||||
while (b < t) {
|
||||
uint8_t x = src[b++];
|
||||
put_bits(&pb, 8, x);
|
||||
if (x == 0xFF) {
|
||||
if (x == 0xFF && b < t) {
|
||||
x = src[b++];
|
||||
if (x & 0x80) {
|
||||
av_log(s->avctx, AV_LOG_WARNING, "Invalid escape sequence\n");
|
||||
|
@@ -144,9 +144,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
{
|
||||
MpegEncContext *s = avctx->priv_data;
|
||||
|
||||
if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && avctx->height > 2800)
|
||||
avctx->thread_count = 1;
|
||||
|
||||
if (ff_mpv_encode_init(avctx) < 0)
|
||||
return -1;
|
||||
|
||||
|
@@ -2730,6 +2730,11 @@ int ff_mpv_reallocate_putbitbuffer(MpegEncContext *s, size_t threshold, size_t s
|
||||
uint8_t *new_buffer = NULL;
|
||||
int new_buffer_size = 0;
|
||||
|
||||
if ((s->avctx->internal->byte_buffer_size + size_increase) >= INT_MAX/8) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Cannot reallocate putbit buffer\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
av_fast_padded_malloc(&new_buffer, &new_buffer_size,
|
||||
s->avctx->internal->byte_buffer_size + size_increase);
|
||||
if (!new_buffer)
|
||||
|
@@ -181,6 +181,12 @@ int ff_slice_thread_init(AVCodecContext *avctx)
|
||||
w32thread_init();
|
||||
#endif
|
||||
|
||||
// We cannot do this in the encoder init as the threads are created before
|
||||
if (av_codec_is_encoder(avctx->codec) &&
|
||||
avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO &&
|
||||
avctx->height > 2800)
|
||||
thread_count = avctx->thread_count = 1;
|
||||
|
||||
if (!thread_count) {
|
||||
int nb_cpus = av_cpu_count();
|
||||
if (avctx->height)
|
||||
|
@@ -106,7 +106,7 @@ static inline void flush_put_bits(PutBitContext *s)
|
||||
s->bit_buf <<= s->bit_left;
|
||||
#endif
|
||||
while (s->bit_left < 32) {
|
||||
/* XXX: should test end of buffer */
|
||||
av_assert0(s->buf_ptr < s->buf_end);
|
||||
#ifdef BITSTREAM_WRITER_LE
|
||||
*s->buf_ptr++ = s->bit_buf;
|
||||
s->bit_buf >>= 8;
|
||||
|
@@ -91,6 +91,7 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src)
|
||||
break;
|
||||
if (*p == '>')
|
||||
p++;
|
||||
continue;
|
||||
}
|
||||
if (!av_isspace(*p))
|
||||
av_bprint_chars(dst, *p, 1);
|
||||
|
@@ -1000,8 +1000,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
|
||||
av_log(s->avctx, AV_LOG_ERROR, "subsample count invalid\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
for (i = 0; i < count; i++)
|
||||
for (i = 0; i < count; i++) {
|
||||
s->subsampling[i] = ff_tget(&s->gb, type, s->le);
|
||||
if (s->subsampling[i] <= 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "subsampling %d is invalid\n", s->subsampling[i]);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TIFF_T4OPTIONS:
|
||||
if (s->compr == TIFF_G3)
|
||||
@@ -1249,7 +1254,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
avpkt->size - s->strippos);
|
||||
}
|
||||
|
||||
if (s->rps <= 0) {
|
||||
if (s->rps <= 0 || s->rps % s->subsampling[1]) {
|
||||
av_log(avctx, AV_LOG_ERROR, "rps %d invalid\n", s->rps);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
@@ -568,6 +568,11 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
rangebits = get_bits(gb, 4);
|
||||
if (!rangebits && floor_setup->data.t1.partitions) {
|
||||
av_log(vc->avctx, AV_LOG_ERROR,
|
||||
"A rangebits value of 0 is not compliant with the Vorbis I specification.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
rangemax = (1 << rangebits);
|
||||
if (rangemax > vc->blocksize[1] / 2) {
|
||||
av_log(vc->avctx, AV_LOG_ERROR,
|
||||
@@ -784,6 +789,11 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
|
||||
|
||||
if (get_bits1(gb)) {
|
||||
mapping_setup->coupling_steps = get_bits(gb, 8) + 1;
|
||||
if (vc->audio_channels < 2) {
|
||||
av_log(vc->avctx, AV_LOG_ERROR,
|
||||
"Square polar channel mapping with less than two channels is not compliant with the Vorbis I specification.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
mapping_setup->magnitude = av_mallocz(mapping_setup->coupling_steps *
|
||||
sizeof(*mapping_setup->magnitude));
|
||||
mapping_setup->angle = av_mallocz(mapping_setup->coupling_steps *
|
||||
|
@@ -32,6 +32,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
WMACodecContext *s = avctx->priv_data;
|
||||
int i, flags1, flags2, block_align;
|
||||
uint8_t *extradata;
|
||||
int ret;
|
||||
|
||||
s->avctx = avctx;
|
||||
|
||||
@@ -78,7 +79,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
if (avctx->channels == 2)
|
||||
s->ms_stereo = 1;
|
||||
|
||||
ff_wma_init(avctx, flags2);
|
||||
if ((ret = ff_wma_init(avctx, flags2)) < 0)
|
||||
return ret;
|
||||
|
||||
/* init MDCT */
|
||||
for (i = 0; i < s->nb_block_sizes; i++)
|
||||
|
@@ -78,6 +78,18 @@
|
||||
* if its AVClass is non-NULL, and the protocols layer. See the discussion on
|
||||
* nesting in @ref avoptions documentation to learn how to access those.
|
||||
*
|
||||
* @section urls
|
||||
* URL strings in libavformat are made of a scheme/protocol, a ':', and a
|
||||
* scheme specific string. URLs without a scheme and ':' used for local files
|
||||
* are supported but deprecated. "file:" should be used for local files.
|
||||
*
|
||||
* It is important that the scheme string is not taken from untrusted
|
||||
* sources without checks.
|
||||
*
|
||||
* Note that some schemes/protocols are quite powerful, allowing access to
|
||||
* both local and remote files, parts of them, concatenations of them, local
|
||||
* audio and video devices and so on.
|
||||
*
|
||||
* @defgroup lavf_decoding Demuxing
|
||||
* @{
|
||||
* Demuxers read a media file and split it into chunks of data (@em packets). A
|
||||
@@ -88,10 +100,10 @@
|
||||
* cleanup.
|
||||
*
|
||||
* @section lavf_decoding_open Opening a media file
|
||||
* The minimum information required to open a file is its URL or filename, which
|
||||
* The minimum information required to open a file is its URL, which
|
||||
* is passed to avformat_open_input(), as in the following code:
|
||||
* @code
|
||||
* const char *url = "in.mp3";
|
||||
* const char *url = "file:in.mp3";
|
||||
* AVFormatContext *s = NULL;
|
||||
* int ret = avformat_open_input(&s, url, NULL, NULL);
|
||||
* if (ret < 0)
|
||||
@@ -1985,7 +1997,7 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score
|
||||
*
|
||||
* @param pb the bytestream to probe
|
||||
* @param fmt the input format is put here
|
||||
* @param filename the filename of the stream
|
||||
* @param url the url of the stream
|
||||
* @param logctx the log context
|
||||
* @param offset the offset within the bytestream to probe from
|
||||
* @param max_probe_size the maximum probe buffer size (zero for default)
|
||||
@@ -1994,14 +2006,14 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score
|
||||
* AVERROR code otherwise
|
||||
*/
|
||||
int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
|
||||
const char *filename, void *logctx,
|
||||
const char *url, void *logctx,
|
||||
unsigned int offset, unsigned int max_probe_size);
|
||||
|
||||
/**
|
||||
* Like av_probe_input_buffer2() but returns 0 on success
|
||||
*/
|
||||
int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
|
||||
const char *filename, void *logctx,
|
||||
const char *url, void *logctx,
|
||||
unsigned int offset, unsigned int max_probe_size);
|
||||
|
||||
/**
|
||||
@@ -2012,7 +2024,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
|
||||
* May be a pointer to NULL, in which case an AVFormatContext is allocated by this
|
||||
* function and written into ps.
|
||||
* Note that a user-supplied AVFormatContext will be freed on failure.
|
||||
* @param filename Name of the stream to open.
|
||||
* @param url URL of the stream to open.
|
||||
* @param fmt If non-NULL, this parameter forces a specific input format.
|
||||
* Otherwise the format is autodetected.
|
||||
* @param options A dictionary filled with AVFormatContext and demuxer-private options.
|
||||
@@ -2023,7 +2035,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
|
||||
*
|
||||
* @note If you want to use custom IO, preallocate the format context and set its pb field.
|
||||
*/
|
||||
int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options);
|
||||
int avformat_open_input(AVFormatContext **ps, const char *url, AVInputFormat *fmt, AVDictionary **options);
|
||||
|
||||
attribute_deprecated
|
||||
int av_demuxer_open(AVFormatContext *ic);
|
||||
|
@@ -155,9 +155,16 @@ static int url_alloc_for_protocol(URLContext **puc, struct URLProtocol *up,
|
||||
char sep= *++p;
|
||||
char *key, *val;
|
||||
p++;
|
||||
|
||||
if (strcmp(up->name, "subfile"))
|
||||
ret = AVERROR(EINVAL);
|
||||
|
||||
while(ret >= 0 && (key= strchr(p, sep)) && p<key && (val = strchr(key+1, sep))){
|
||||
*val= *key= 0;
|
||||
ret= av_opt_set(uc->priv_data, p, key+1, 0);
|
||||
if (strcmp(p, "start") && strcmp(p, "end")) {
|
||||
ret = AVERROR_OPTION_NOT_FOUND;
|
||||
} else
|
||||
ret= av_opt_set(uc->priv_data, p, key+1, 0);
|
||||
if (ret == AVERROR_OPTION_NOT_FOUND)
|
||||
av_log(uc, AV_LOG_ERROR, "Key '%s' not found.\n", p);
|
||||
*val= *key= sep;
|
||||
@@ -222,7 +229,7 @@ static struct URLProtocol *url_find_protocol(const char *filename)
|
||||
size_t proto_len = strspn(filename, URL_SCHEME_CHARS);
|
||||
|
||||
if (filename[proto_len] != ':' &&
|
||||
(filename[proto_len] != ',' || !strchr(filename + proto_len + 1, ':')) ||
|
||||
(strncmp(filename, "subfile,", 8) || !strchr(filename + proto_len + 1, ':')) ||
|
||||
is_dos_path(filename))
|
||||
strcpy(proto_str, "file");
|
||||
else
|
||||
|
@@ -260,6 +260,16 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
if (codec->codec_id == AV_CODEC_ID_ADPCM_THP) {
|
||||
uint8_t *dst;
|
||||
|
||||
if (!b->adpc) {
|
||||
av_log(s, AV_LOG_ERROR, "adpcm_thp requires ADPC chunk, but none was found.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (!b->table) {
|
||||
b->table = av_mallocz(32 * codec->channels);
|
||||
if (!b->table)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
if (av_new_packet(pkt, 8 + (32 + 4) * codec->channels + size) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
dst = pkt->data;
|
||||
|
@@ -65,7 +65,10 @@ static av_cold int concat_open(URLContext *h, const char *uri, int flags)
|
||||
struct concat_data *data = h->priv_data;
|
||||
struct concat_nodes *nodes;
|
||||
|
||||
av_strstart(uri, "concat:", &uri);
|
||||
if (!av_strstart(uri, "concat:", &uri)) {
|
||||
av_log(h, AV_LOG_ERROR, "URL %s lacks prefix\n", uri);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
for (i = 0, len = 1; uri[i]; i++) {
|
||||
if (uri[i] == *AV_CAT_SEPARATOR) {
|
||||
|
@@ -113,9 +113,10 @@ static int ffm_read_data(AVFormatContext *s,
|
||||
ffm->dts = avio_rb64(pb);
|
||||
frame_offset = avio_rb16(pb);
|
||||
avio_read(pb, ffm->packet, ffm->packet_size - FFM_HEADER_SIZE);
|
||||
ffm->packet_end = ffm->packet + (ffm->packet_size - FFM_HEADER_SIZE - fill_size);
|
||||
if (ffm->packet_end < ffm->packet || frame_offset < 0)
|
||||
if (ffm->packet_size < FFM_HEADER_SIZE + fill_size || frame_offset < 0) {
|
||||
return -1;
|
||||
}
|
||||
ffm->packet_end = ffm->packet + (ffm->packet_size - FFM_HEADER_SIZE - fill_size);
|
||||
/* if first packet or resynchronization packet, we must
|
||||
handle it specifically */
|
||||
if (ffm->first_packet || (frame_offset & 0x8000)) {
|
||||
@@ -131,8 +132,10 @@ static int ffm_read_data(AVFormatContext *s,
|
||||
return 0;
|
||||
}
|
||||
ffm->first_packet = 0;
|
||||
if ((frame_offset & 0x7fff) < FFM_HEADER_SIZE)
|
||||
if ((frame_offset & 0x7fff) < FFM_HEADER_SIZE) {
|
||||
ffm->packet_end = ffm->packet_ptr;
|
||||
return -1;
|
||||
}
|
||||
ffm->packet_ptr = ffm->packet + (frame_offset & 0x7fff) - FFM_HEADER_SIZE;
|
||||
if (!header)
|
||||
break;
|
||||
|
@@ -156,7 +156,7 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
|
||||
|
||||
/* send both the decode map and the video data together */
|
||||
|
||||
if (av_new_packet(pkt, s->decode_map_chunk_size + s->video_chunk_size))
|
||||
if (av_new_packet(pkt, 2 + s->decode_map_chunk_size + s->video_chunk_size))
|
||||
return CHUNK_NOMEM;
|
||||
|
||||
if (s->has_palette) {
|
||||
@@ -178,7 +178,8 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
|
||||
avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);
|
||||
s->decode_map_chunk_offset = 0;
|
||||
|
||||
if (avio_read(pb, pkt->data, s->decode_map_chunk_size) !=
|
||||
AV_WL16(pkt->data, s->decode_map_chunk_size);
|
||||
if (avio_read(pb, pkt->data + 2, s->decode_map_chunk_size) !=
|
||||
s->decode_map_chunk_size) {
|
||||
av_free_packet(pkt);
|
||||
return CHUNK_EOF;
|
||||
@@ -187,7 +188,7 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
|
||||
avio_seek(pb, s->video_chunk_offset, SEEK_SET);
|
||||
s->video_chunk_offset = 0;
|
||||
|
||||
if (avio_read(pb, pkt->data + s->decode_map_chunk_size,
|
||||
if (avio_read(pb, pkt->data + 2 + s->decode_map_chunk_size,
|
||||
s->video_chunk_size) != s->video_chunk_size) {
|
||||
av_free_packet(pkt);
|
||||
return CHUNK_EOF;
|
||||
|
@@ -190,6 +190,7 @@ typedef struct MOVContext {
|
||||
MOVFragmentIndex** fragment_index_data;
|
||||
unsigned fragment_index_count;
|
||||
int atom_depth;
|
||||
int enable_drefs;
|
||||
} MOVContext;
|
||||
|
||||
int ff_mp4_read_descr_len(AVIOContext *pb);
|
||||
|
@@ -79,6 +79,20 @@ static int libquvi_read_header(AVFormatContext *s)
|
||||
if ((ret = ff_copy_whitelists(qc->fmtctx, s)) < 0)
|
||||
goto end;
|
||||
|
||||
if (!qc->fmtctx->format_whitelist) {
|
||||
qc->fmtctx->format_whitelist = av_strdup("avi,asf,flv,mov,mpeg,mpegts,aac,h264,hevc,mp3,ogg,matroska,mxf,mp2");
|
||||
if (!qc->fmtctx->format_whitelist) {
|
||||
avformat_free_context(qc->fmtctx);
|
||||
qc->fmtctx = NULL;
|
||||
goto err_quvi_cleanup;
|
||||
}
|
||||
}
|
||||
if (strncmp(media_url, "http:", 5) && strncmp(media_url, "https:", 6)) {
|
||||
avformat_free_context(qc->fmtctx);
|
||||
qc->fmtctx = NULL;
|
||||
goto err_quvi_cleanup;
|
||||
}
|
||||
|
||||
ret = avformat_open_input(&qc->fmtctx, media_url, NULL, NULL);
|
||||
if (ret < 0)
|
||||
goto end;
|
||||
|
@@ -2559,13 +2559,23 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
|
||||
if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) {
|
||||
MOVDref *dref = &sc->drefs[sc->dref_id - 1];
|
||||
if (mov_open_dref(&sc->pb, c->fc->filename, dref, &c->fc->interrupt_callback,
|
||||
c->use_absolute_path, c->fc) < 0)
|
||||
av_log(c->fc, AV_LOG_ERROR,
|
||||
"stream %d, error opening alias: path='%s', dir='%s', "
|
||||
"filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
|
||||
if (c->enable_drefs) {
|
||||
if (mov_open_dref(&sc->pb, c->fc->filename, dref, &c->fc->interrupt_callback,
|
||||
c->use_absolute_path, c->fc) < 0)
|
||||
av_log(c->fc, AV_LOG_ERROR,
|
||||
"stream %d, error opening alias: path='%s', dir='%s', "
|
||||
"filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
|
||||
st->index, dref->path, dref->dir, dref->filename,
|
||||
dref->volume, dref->nlvl_from, dref->nlvl_to);
|
||||
} else {
|
||||
av_log(c->fc, AV_LOG_WARNING,
|
||||
"Skipped opening external track: "
|
||||
"stream %d, alias: path='%s', dir='%s', "
|
||||
"filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d."
|
||||
"Set enable_drefs to allow this.\n",
|
||||
st->index, dref->path, dref->dir, dref->filename,
|
||||
dref->volume, dref->nlvl_from, dref->nlvl_to);
|
||||
}
|
||||
} else {
|
||||
sc->pb = c->fc->pb;
|
||||
sc->pb_is_copied = 1;
|
||||
@@ -4250,6 +4260,8 @@ static const AVOption mov_options[] = {
|
||||
AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_DECODING_PARAM, "use_mfra_for" },
|
||||
{ "export_all", "Export unrecognized metadata entries", OFFSET(export_all),
|
||||
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = FLAGS },
|
||||
{ "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), AV_OPT_TYPE_INT,
|
||||
{.i64 = 0}, 0, 1, FLAGS },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
@@ -1463,10 +1463,11 @@ int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags)
|
||||
while ((t = av_dict_get(*options, "", t, AV_DICT_IGNORE_SUFFIX))) {
|
||||
ret = av_opt_set(obj, t->key, t->value, search_flags);
|
||||
if (ret == AVERROR_OPTION_NOT_FOUND)
|
||||
av_dict_set(&tmp, t->key, t->value, 0);
|
||||
else if (ret < 0) {
|
||||
ret = av_dict_set(&tmp, t->key, t->value, 0);
|
||||
if (ret < 0) {
|
||||
av_log(obj, AV_LOG_ERROR, "Error setting option %s to value %s.\n", t->key, t->value);
|
||||
break;
|
||||
av_dict_free(&tmp);
|
||||
return ret;
|
||||
}
|
||||
ret = 0;
|
||||
}
|
||||
|
@@ -399,7 +399,7 @@ bad_option:
|
||||
for (y = 0; y < H; y++)
|
||||
for (x = 0; x < W * 4; x++)
|
||||
rgb_data[ x + y * 4 * W] = av_lfg_get(&rand);
|
||||
sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride);
|
||||
sws_scale(sws, rgb_src, rgb_stride, 0, H / 12, src, stride);
|
||||
sws_freeContext(sws);
|
||||
av_free(rgb_data);
|
||||
|
||||
|
@@ -895,11 +895,19 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
|
||||
const uint8_t *src2[4];
|
||||
uint8_t *dst2[4];
|
||||
uint8_t *rgb0_tmp = NULL;
|
||||
int macro_height = isBayer(c->srcFormat) ? 2 : (1 << c->chrSrcVSubSample);
|
||||
|
||||
if (!srcStride || !dstStride || !dst || !srcSlice) {
|
||||
av_log(c, AV_LOG_ERROR, "One of the input parameters to sws_scale() is NULL, please check the calling code\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((srcSliceY & (macro_height-1)) ||
|
||||
((srcSliceH& (macro_height-1)) && srcSliceY + srcSliceH != c->srcH) ||
|
||||
srcSliceY + srcSliceH > c->srcH) {
|
||||
av_log(c, AV_LOG_ERROR, "Slice parameters %d, %d are invalid\n", srcSliceY, srcSliceH);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (c->cascaded_context[0] && srcSliceY == 0 && srcSliceH == c->cascaded_context[0]->srcH) {
|
||||
ret = sws_scale(c->cascaded_context[0],
|
||||
srcSlice, srcStride, srcSliceY, srcSliceH,
|
||||
|
@@ -1058,6 +1058,8 @@ static int bayer_to_rgb24_wrapper(SwsContext *c, const uint8_t* src[], int srcSt
|
||||
default: return 0;
|
||||
}
|
||||
|
||||
av_assert0(srcSliceH > 1);
|
||||
|
||||
copy(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);
|
||||
srcPtr += 2 * srcStride[0];
|
||||
dstPtr += 2 * dstStride[0];
|
||||
@@ -1068,7 +1070,10 @@ static int bayer_to_rgb24_wrapper(SwsContext *c, const uint8_t* src[], int srcSt
|
||||
dstPtr += 2 * dstStride[0];
|
||||
}
|
||||
|
||||
copy(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);
|
||||
if (i + 1 == srcSliceH) {
|
||||
copy(srcPtr, -srcStride[0], dstPtr, -dstStride[0], c->srcW);
|
||||
} else if (i < srcSliceH)
|
||||
copy(srcPtr, srcStride[0], dstPtr, dstStride[0], c->srcW);
|
||||
return srcSliceH;
|
||||
}
|
||||
|
||||
@@ -1104,6 +1109,8 @@ static int bayer_to_yv12_wrapper(SwsContext *c, const uint8_t* src[], int srcStr
|
||||
default: return 0;
|
||||
}
|
||||
|
||||
av_assert0(srcSliceH > 1);
|
||||
|
||||
copy(srcPtr, srcStride[0], dstY, dstU, dstV, dstStride[0], c->srcW, c->input_rgb2yuv_table);
|
||||
srcPtr += 2 * srcStride[0];
|
||||
dstY += 2 * dstStride[0];
|
||||
@@ -1118,7 +1125,10 @@ static int bayer_to_yv12_wrapper(SwsContext *c, const uint8_t* src[], int srcStr
|
||||
dstV += dstStride[1];
|
||||
}
|
||||
|
||||
copy(srcPtr, srcStride[0], dstY, dstU, dstV, dstStride[0], c->srcW, c->input_rgb2yuv_table);
|
||||
if (i + 1 == srcSliceH) {
|
||||
copy(srcPtr, -srcStride[0], dstY, dstU, dstV, -dstStride[0], c->srcW, c->input_rgb2yuv_table);
|
||||
} else if (i < srcSliceH)
|
||||
copy(srcPtr, srcStride[0], dstY, dstU, dstV, dstStride[0], c->srcW, c->input_rgb2yuv_table);
|
||||
return srcSliceH;
|
||||
}
|
||||
|
||||
|
@@ -1434,7 +1434,9 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWid
|
||||
dst+= dstStride;
|
||||
|
||||
for (y=1; y<srcHeight; y++) {
|
||||
const x86_reg mmxSize= srcWidth&~15;
|
||||
x86_reg mmxSize= srcWidth&~15;
|
||||
|
||||
if (mmxSize) {
|
||||
__asm__ volatile(
|
||||
"mov %4, %%"REG_a" \n\t"
|
||||
"movq "MANGLE(mmx_ff)", %%mm0 \n\t"
|
||||
@@ -1481,6 +1483,11 @@ static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWid
|
||||
NAMED_CONSTRAINTS_ADD(mmx_ff)
|
||||
: "%"REG_a
|
||||
);
|
||||
} else {
|
||||
mmxSize = 1;
|
||||
dst[0] = (src[0] * 3 + src[srcStride]) >> 2;
|
||||
dst[dstStride] = (src[0] + 3 * src[srcStride]) >> 2;
|
||||
}
|
||||
|
||||
for (x=mmxSize-1; x<srcWidth-1; x++) {
|
||||
dst[2*x +1]= (3*src[x+0] + src[x+srcStride+1])>>2;
|
||||
|
Reference in New Issue
Block a user