From 0fd88d398896353074fee153259dbf3530ca423f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 09:12:59 +0100 Subject: riff: remove references to sonic codec ids They are deprecated and will be purged on next major bump. --- libavformat/riff.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'libavformat') diff --git a/libavformat/riff.c b/libavformat/riff.c index 8489bc7ae6..4caac80643 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -327,8 +327,6 @@ const AVCodecTag ff_codec_wav_tags[] = { { CODEC_ID_AAC_LATM, 0x1602 }, { CODEC_ID_AC3, 0x2000 }, { CODEC_ID_DTS, 0x2001 }, - { CODEC_ID_SONIC, 0x2048 }, - { CODEC_ID_SONIC_LS, 0x2048 }, { CODEC_ID_PCM_MULAW, 0x6c75 }, { CODEC_ID_AAC, 0x706d }, { CODEC_ID_AAC, 0x4143 }, -- cgit v1.2.3 From e5c708151e3dbf09c9564051c432b1b83a1674d0 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 09:36:11 +0100 Subject: lavf: undeprecate read_seek(). The "new seeking API" was never finished and nobody is working on it. --- libavformat/avformat.h | 7 +++---- libavformat/version.h | 3 --- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'libavformat') diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 89b9eda4a4..fff911a483 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -503,7 +503,6 @@ typedef struct AVInputFormat { */ int (*read_close)(struct AVFormatContext *); -#if FF_API_READ_SEEK /** * Seek to a given timestamp relative to the frames in * stream component stream_index. @@ -512,9 +511,9 @@ typedef struct AVInputFormat { * match is available. * @return >= 0 on success (but not necessarily the new offset) */ - attribute_deprecated int (*read_seek)(struct AVFormatContext *, - int stream_index, int64_t timestamp, int flags); -#endif + int (*read_seek)(struct AVFormatContext *, + int stream_index, int64_t timestamp, int flags); + /** * Get the next timestamp in stream[stream_index].time_base units. * @return the timestamp or AV_NOPTS_VALUE if an error occurred diff --git a/libavformat/version.h b/libavformat/version.h index e113a24482..fb5a1eb9db 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -50,9 +50,6 @@ #ifndef FF_API_OLD_METADATA2 #define FF_API_OLD_METADATA2 (LIBAVFORMAT_VERSION_MAJOR < 54) #endif -#ifndef FF_API_READ_SEEK -#define FF_API_READ_SEEK (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_OLD_AVIO #define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 54) #endif -- cgit v1.2.3 From 44bcab5883fcfdc9e9b1cc5315e994fd33391deb Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 09:38:13 +0100 Subject: ffmenc: remove references to deprecated AVFormatContext.timestamp. --- libavformat/ffmenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavformat') diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c index d304f57ac4..b8d3d315bd 100644 --- a/libavformat/ffmenc.c +++ b/libavformat/ffmenc.c @@ -205,7 +205,7 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) uint8_t header[FRAME_HEADER_SIZE+4]; int header_size = FRAME_HEADER_SIZE; - dts = s->timestamp + pkt->dts; + dts = pkt->dts; /* packet size & key_frame */ header[0] = pkt->stream_index; header[1] = 0; @@ -213,7 +213,7 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) header[1] |= FLAG_KEY_FRAME; AV_WB24(header+2, pkt->size); AV_WB24(header+5, pkt->duration); - AV_WB64(header+8, s->timestamp + pkt->pts); + AV_WB64(header+8, pkt->pts); if (pkt->pts != pkt->dts) { header[1] |= FLAG_DTS; AV_WB32(header+16, pkt->pts - pkt->dts); -- cgit v1.2.3 From 6b9e4eea839b9f75dc4cad628c923d5c70d704d1 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Thu, 12 Jan 2012 17:06:04 +0200 Subject: avio: Fix the value of the deprecated URL_FLAG_NONBLOCK This isn't used in practice anywhere within libav at the moment, but change it for consistency until it is removed. URL_RDONLY/WRONLY were fixed in commit 5b81e295931 (after the values that actually were used were changed at the major bump, in commit cbea3ac8), but this flag was unintentionally left unfixed. Signed-off-by: Martin Storsjö --- libavformat/avio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/avio.h b/libavformat/avio.h index e73264f4aa..78935d9416 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -204,7 +204,7 @@ attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout); * Warning: non-blocking protocols is work-in-progress; this flag may be * silently ignored. */ -#define URL_FLAG_NONBLOCK 4 +#define URL_FLAG_NONBLOCK 8 typedef int URLInterruptCB(void); extern URLInterruptCB *url_interrupt_cb; -- cgit v1.2.3 From 4df30f71147b7bedd4457bcfa0e4efe01085af9f Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Thu, 12 Jan 2012 11:12:24 -0800 Subject: utils: Check for extradata size overflows. --- libavcodec/internal.h | 7 +++++++ libavcodec/utils.c | 3 +++ libavformat/utils.c | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavcodec/internal.h b/libavcodec/internal.h index b5a04546f3..1c2d0daaef 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -94,4 +94,11 @@ unsigned int avpriv_toupper4(unsigned int x); int avpriv_lock_avformat(void); int avpriv_unlock_avformat(void); +/** + * Maximum size in bytes of extradata. + * This value was chosen such that every bit of the buffer is + * addressable by a 32-bit signed integer as used by get_bits. + */ +#define FF_MAX_EXTRADATA_SIZE ((1 << 28) - FF_INPUT_BUFFER_PADDING_SIZE) + #endif /* AVCODEC_INTERNAL_H */ diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 2bc1dcf5da..6f4d7e68da 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -610,6 +610,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD int ret = 0; AVDictionary *tmp = NULL; + if (avctx->extradata_size < 0 || avctx->extradata_size >= FF_MAX_EXTRADATA_SIZE) + return AVERROR(EINVAL); + if (options) av_dict_copy(&tmp, *options, 0); diff --git a/libavformat/utils.c b/libavformat/utils.c index a79665801f..373f06831d 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2442,9 +2442,11 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) } if(st->parser && st->parser->parser->split && !st->codec->extradata){ int i= st->parser->parser->split(st->codec, pkt->data, pkt->size); - if(i){ + if (i > 0 && i < FF_MAX_EXTRADATA_SIZE) { st->codec->extradata_size= i; st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + if (!st->codec->extradata) + return AVERROR(ENOMEM); memcpy(st->codec->extradata, pkt->data, st->codec->extradata_size); memset(st->codec->extradata + i, 0, FF_INPUT_BUFFER_PADDING_SIZE); } -- cgit v1.2.3