[FFmpeg-cvslog] avcodec/flacdec: Call ff_flacdsp_init() unconditionally
ffmpeg | branch: master | Michael Niedermayer | Wed Nov 26 03:29:03 2014 +0100| [e5c01ccdf5a9a330d4c51a9b9ea721fd8f1fb70b] | committer: Michael Niedermayer avcodec/flacdec: Call ff_flacdsp_init() unconditionally Fixes out of array access Fixes: signal_sigsegv_324b135_3398_cov_246853371_short.flac Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5c01ccdf5a9a330d4c51a9b9ea721fd8f1fb70b --- libavcodec/flacdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 9b1e428..cda44ba 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -472,10 +472,10 @@ static int decode_frame(FLACContext *s) ret = allocate_buffers(s); if (ret < 0) return ret; -ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->channels, s->bps); s->got_streaminfo = 1; dump_headers(s->avctx, (FLACStreaminfo *)s); } +ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->channels, s->bps); //dump_headers(s->avctx, (FLACStreaminfo *)s); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/flacdec: fix off by 1 error
ffmpeg | branch: master | Michael Niedermayer | Wed Nov 26 04:07:34 2014 +0100| [5f30522894d19a14324b80bc282c094dabdb31c0] | committer: Michael Niedermayer avcodec/flacdec: fix off by 1 error Fixes assertion failure Fixes: signal_sigsegv_324b284_1980_dilvie___the_dragonfly.flac Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5f30522894d19a14324b80bc282c094dabdb31c0 --- libavcodec/flacdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index cda44ba..34a0a70 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -366,7 +366,7 @@ static inline int decode_subframe(FLACContext *s, int channel) if (get_bits1(&s->gb)) { int left = get_bits_left(&s->gb); -if ( left < 0 || +if ( left <= 0 || (left < bps && !show_bits_long(&s->gb, left)) || !show_bits_long(&s->gb, bps)) { av_log(s->avctx, AV_LOG_ERROR, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mxfdec: dont ask for samples with field dominance 0 anymore
ffmpeg | branch: master | Michael Niedermayer | Wed Nov 26 02:07:57 2014 +0100| [2ad38c6e02cc19fa6e7d5e33b8c4f68264f8ae66] | committer: Michael Niedermayer avformat/mxfdec: dont ask for samples with field dominance 0 anymore Based on discussion and patch from "[FFmpeg-devel] [PATCH]Do not ask for mxf samples with unknown field dominance" Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ad38c6e02cc19fa6e7d5e33b8c4f68264f8ae66 --- libavformat/mxfdec.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 37d0fae..bc0a10b 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1771,6 +1771,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) avpriv_request_sample(mxf->fc, "Field dominance %d support", descriptor->field_dominance); +case 0: // we already have many samples with field_dominance == unknown break; } /* Turn field height into frame height. */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/apngdec: account for blend and dispose operations.
ffmpeg | branch: master | Benoit Fouet | Tue Nov 25 10:52:21 2014 +0100| [4acefd25215a0d0ac6cf65971e73400eaaa5e64e] | committer: Michael Niedermayer avformat/apngdec: account for blend and dispose operations. When the dimensions are the entire frame ones, and the dispose operation is to reset to background, or the new frame overwrites the new one, then consider the frame as a key one. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4acefd25215a0d0ac6cf65971e73400eaaa5e64e --- libavformat/apng.h| 41 + libavformat/apngdec.c |6 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/libavformat/apng.h b/libavformat/apng.h new file mode 100644 index 000..2abf011 --- /dev/null +++ b/libavformat/apng.h @@ -0,0 +1,41 @@ +/* + * APNG common header + * Copyright (c) 2014 Benoit Fouet + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * APNG common header + */ + +#ifndef AVFORMAT_APNG_H +#define AVFORMAT_APNG_H + +enum { + APNG_DISPOSE_OP_NONE = 0, + APNG_DISPOSE_OP_BACKGROUND = 1, + APNG_DISPOSE_OP_PREVIOUS = 2, +}; + +enum { +APNG_BLEND_OP_SOURCE = 0, +APNG_BLEND_OP_OVER = 1, +}; + +#endif /* AVFORMAT_APNG_H */ diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c index d766a87..dac71f1 100644 --- a/libavformat/apngdec.c +++ b/libavformat/apngdec.c @@ -26,6 +26,7 @@ * @see http://www.w3.org/TR/PNG */ +#include "apng.h" #include "avformat.h" #include "avio_internal.h" #include "internal.h" @@ -298,7 +299,10 @@ static int decode_fctl_chunk(AVFormatContext *s, APNGDemuxContext *ctx, AVPacket return AVERROR_INVALIDDATA; ctx->is_key_frame = 0; } else { -ctx->is_key_frame = 1; +if (sequence_number == 0 && dispose_op == APNG_DISPOSE_OP_PREVIOUS) +dispose_op = APNG_DISPOSE_OP_BACKGROUND; +ctx->is_key_frame = dispose_op == APNG_DISPOSE_OP_BACKGROUND || +blend_op == APNG_BLEND_OP_SOURCE; } return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Rename sync() functions in libavformat.
ffmpeg | branch: master | Carl Eugen Hoyos | Tue Nov 25 23:49:58 2014 +0100| [5badcdf20d98b7edede3d7701d31dba58822a99a] | committer: Carl Eugen Hoyos Rename sync() functions in libavformat. Fixes compilation on Android where the sync() definition in unistd.h interferes with the static definitions in libavformat. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5badcdf20d98b7edede3d7701d31dba58822a99a --- libavformat/lxfdec.c |4 ++-- libavformat/rmdec.c |6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c index 11d6da5..fb37da7 100644 --- a/libavformat/lxfdec.c +++ b/libavformat/lxfdec.c @@ -83,7 +83,7 @@ static int check_checksum(const uint8_t *header, int size) * @param[out] header where to copy the ident to * @return 0 if an ident was found, < 0 on I/O error */ -static int sync(AVFormatContext *s, uint8_t *header) +static int lxf_sync(AVFormatContext *s, uint8_t *header) { uint8_t buf[LXF_IDENT_LENGTH]; int ret; @@ -120,7 +120,7 @@ static int get_packet_header(AVFormatContext *s) const uint8_t *p = header + LXF_IDENT_LENGTH; //find and read the ident -if ((ret = sync(s, header)) < 0) +if ((ret = lxf_sync(s, header)) < 0) return ret; ret = avio_read(pb, header + LXF_IDENT_LENGTH, 8); diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 96b9e7f..c46b53f 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -610,7 +610,7 @@ static int get_num(AVIOContext *pb, int *len) /* multiple of 20 bytes for ra144 (ugly) */ #define RAW_PACKET_SIZE 1000 -static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_index, int64_t *pos){ +static int rm_sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_index, int64_t *pos){ RMDemuxContext *rm = s->priv_data; AVIOContext *pb = s->pb; AVStream *st; @@ -964,7 +964,7 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt) flags = (seq++ == 1) ? 2 : 0; pos = avio_tell(s->pb); } else { -len=sync(s, ×tamp, &flags, &i, &pos); +len = rm_sync(s, ×tamp, &flags, &i, &pos); if (len > 0) st = s->streams[i]; } @@ -1035,7 +1035,7 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index, int seq=1; AVStream *st; -len=sync(s, &dts, &flags, &stream_index2, &pos); +len = rm_sync(s, &dts, &flags, &stream_index2, &pos); if(len<0) return AV_NOPTS_VALUE; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/utils: free private options on avcodec_open2 fail
ffmpeg | branch: master | Lukasz Marek | Sun Nov 23 00:55:33 2014 +0100| [1907ff0a67edeb98d9153aac79f35961837ba3f6] | committer: Lukasz Marek lavc/utils: free private options on avcodec_open2 fail It protects leaking string/binary/dict options from priv context. Signed-off-by: Lukasz Marek > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1907ff0a67edeb98d9153aac79f35961837ba3f6 --- libavcodec/utils.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index c06a733..66fe62c 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1690,6 +1690,8 @@ end: return ret; free_and_end: av_dict_free(&tmp); +if (codec->priv_class && codec->priv_data_size) +av_opt_free(avctx->priv_data); av_freep(&avctx->priv_data); if (avctx->internal) { av_frame_free(&avctx->internal->to_free); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavu/opt: handle NULL obj in av_opt_next
ffmpeg | branch: master | Lukasz Marek | Sun Nov 23 00:48:17 2014 +0100| [ea0d8938173e12b289243c88c6a79dc6651e6ed9] | committer: Lukasz Marek lavu/opt: handle NULL obj in av_opt_next It indirectly also fixes av_opt_free for NULL objs. Signed-off-by: Lukasz Marek > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea0d8938173e12b289243c88c6a79dc6651e6ed9 --- libavutil/opt.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index 0546a37..5b26a00 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -50,7 +50,10 @@ const AVOption *av_next_option(void *obj, const AVOption *last) const AVOption *av_opt_next(void *obj, const AVOption *last) { -AVClass *class = *(AVClass**)obj; +const AVClass *class; +if (!obj) +return NULL; +class = *(const AVClass**)obj; if (!last && class && class->option && class->option[0].name) return class->option; if (last && last[1].name) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/libxvid: return meaningful error codes
ffmpeg | branch: master | Lukasz Marek | Mon Nov 24 01:11:45 2014 +0100| [2a89afb376aebe833bee0b5958cec16c48936b03] | committer: Lukasz Marek lavc/libxvid: return meaningful error codes Signed-off-by: Lukasz Marek > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a89afb376aebe833bee0b5958cec16c48936b03 --- libavcodec/libxvid.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 020af32..046d2f7 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -488,6 +488,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) if (!x->twopassbuffer || !x->old_twopassbuffer) { av_log(avctx, AV_LOG_ERROR, "Xvid: Cannot allocate 2-pass log buffers\n"); +ret = AVERROR(ENOMEM); goto fail; } x->twopassbuffer[0] = @@ -501,8 +502,9 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) rc2pass2.bitrate = avctx->bit_rate; fd = av_tempfile("xvidff.", &x->twopassfile, 0, avctx); -if (fd == -1) { +if (fd < 0) { av_log(avctx, AV_LOG_ERROR, "Xvid: Cannot write 2-pass pipe\n"); +ret = fd; goto fail; } x->twopassfd = fd; @@ -510,14 +512,19 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) if (!avctx->stats_in) { av_log(avctx, AV_LOG_ERROR, "Xvid: No 2-pass information loaded for second pass\n"); +ret = AVERROR(EINVAL); goto fail; } -if (strlen(avctx->stats_in) > -write(fd, avctx->stats_in, strlen(avctx->stats_in))) { +ret = write(fd, avctx->stats_in, strlen(avctx->stats_in)); +if (ret == -1) +ret = AVERROR(errno); +else if (strlen(avctx->stats_in) > ret) { av_log(avctx, AV_LOG_ERROR, "Xvid: Cannot write to 2-pass pipe\n"); -goto fail; +ret = AVERROR(EIO); } +if (ret < 0) +goto fail; rc2pass2.filename = x->twopassfile; plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/avuienc: fix mem leak in case of init failure
ffmpeg | branch: master | Lukasz Marek | Mon Nov 24 04:51:05 2014 +0100| [e29153f414f5b2d10e0386abf7921aed4a4fa454] | committer: Lukasz Marek lavc/avuienc: fix mem leak in case of init failure Signed-off-by: Lukasz Marek > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e29153f414f5b2d10e0386abf7921aed4a4fa454 --- libavcodec/avuienc.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libavcodec/avuienc.c b/libavcodec/avuienc.c index 700b8cb..db640bb 100644 --- a/libavcodec/avuienc.c +++ b/libavcodec/avuienc.c @@ -25,16 +25,10 @@ static av_cold int avui_encode_init(AVCodecContext *avctx) { -avctx->coded_frame = av_frame_alloc(); - if (avctx->width != 720 || avctx->height != 486 && avctx->height != 576) { av_log(avctx, AV_LOG_ERROR, "Only 720x486 and 720x576 are supported.\n"); return AVERROR(EINVAL); } -if (!avctx->coded_frame) { -av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n"); -return AVERROR(ENOMEM); -} if (!(avctx->extradata = av_mallocz(24 + FF_INPUT_BUFFER_PADDING_SIZE))) return AVERROR(ENOMEM); avctx->extradata_size = 24; @@ -45,6 +39,11 @@ static av_cold int avui_encode_init(AVCodecContext *avctx) avctx->extradata[19] = 1; } +avctx->coded_frame = av_frame_alloc(); +if (!avctx->coded_frame) { +av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n"); +return AVERROR(ENOMEM); +} return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'f20141d73f08ed0c8e875bd993a7143e19b266e3'
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 21:36:44 2014 +0100| [23e91a1bfd7f47b343f41915a2c8b33d5c532562] | committer: Michael Niedermayer Merge commit 'f20141d73f08ed0c8e875bd993a7143e19b266e3' * commit 'f20141d73f08ed0c8e875bd993a7143e19b266e3': vorbis_parser: Include stdint.h in the header, to make it work standalone See: e2e36a739d3ad0d207a31c76f414a912d08b1d6d Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=23e91a1bfd7f47b343f41915a2c8b33d5c532562 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vorbis_parser: Include stdint.h in the header, to make it work standalone
ffmpeg | branch: master | Martin Storsjö | Tue Nov 25 10:43:55 2014 +0200| [f20141d73f08ed0c8e875bd993a7143e19b266e3] | committer: Martin Storsjö vorbis_parser: Include stdint.h in the header, to make it work standalone This fixes "make checkheaders". Signed-off-by: Martin Storsjö > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f20141d73f08ed0c8e875bd993a7143e19b266e3 --- libavcodec/vorbis_parser.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/vorbis_parser.h b/libavcodec/vorbis_parser.h index 7b12900..9ae1630 100644 --- a/libavcodec/vorbis_parser.h +++ b/libavcodec/vorbis_parser.h @@ -27,6 +27,8 @@ #ifndef AVCODEC_VORBIS_PARSE_H #define AVCODEC_VORBIS_PARSE_H +#include + typedef struct AVVorbisParseContext AVVorbisParseContext; /** ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc: add entry for APNG demuxer where needed.
ffmpeg | branch: master | Benoit Fouet | Tue Nov 25 10:03:12 2014 +0100| [155f4dd668b8a2a57f1f8dfe225977cdcc5de745] | committer: Michael Niedermayer doc: add entry for APNG demuxer where needed. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=155f4dd668b8a2a57f1f8dfe225977cdcc5de745 --- Changelog |1 + MAINTAINERS |1 + doc/demuxers.texi | 20 3 files changed, 22 insertions(+) diff --git a/Changelog b/Changelog index 486c127..7172d0c 100644 --- a/Changelog +++ b/Changelog @@ -16,6 +16,7 @@ version : - creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer - WebP muxer with animated WebP support - zygoaudio decoding support +- APNG demuxer version 2.4: diff --git a/MAINTAINERS b/MAINTAINERS index ef120e4..15b976f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -386,6 +386,7 @@ Muxers/Demuxers: aiffdec.c Baptiste Coudurier, Matthieu Bouron aiffenc.c Baptiste Coudurier, Matthieu Bouron ape.c Kostya Shishkov + apngdec.c Benoit Fouet ass* Aurelien Jacobs astdec.c Paul B Mahol astenc.c James Almer diff --git a/doc/demuxers.texi b/doc/demuxers.texi index e582322..11dfe1b 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -29,6 +29,26 @@ the caller can decide which variant streams to actually receive. The total bitrate of the variant that the stream belongs to is available in a metadata key named "variant_bitrate". +@section apng + +Animated Portable Network Graphics demuxer. + +This demuxer is used to demux APNG files. +All headers, but the PNG signature, up to (but not including) the first +fcTL chunk are transmitted as extradata. +Frames are then split as being all the chunks between two fcTL ones, or +between the last fcTL and IEND chunks. + +@table @option +@item -ignore_loop @var{bool} +Ignore the loop variable in the file if set. +@item -max_fps @var{int} +Maximum framerate in frames per second (0 for no limit). +@item -default_fps @var{int} +Default framerate in frames per second when none is specified in the file +(0 meaning as fast as possible). +@end table + @section asf Advanced Systems Format demuxer. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavf/avio: clarify the buffer parameter of avio_alloc_context
ffmpeg | branch: master | Yu Xiaolei | Tue Nov 25 16:35:29 2014 +0800| [bc3d02fa88c4d1a45952da8d058f5667913627b9] | committer: Michael Niedermayer lavf/avio: clarify the buffer parameter of avio_alloc_context Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc3d02fa88c4d1a45952da8d058f5667913627b9 --- libavformat/avio.h |3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/avio.h b/libavformat/avio.h index 86f754e..b9b4017 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -186,6 +186,9 @@ int avio_check(const char *url, int flags); * * @param buffer Memory block for input/output operations via AVIOContext. *The buffer must be allocated with av_malloc() and friends. + *It may be freed and replaced with a new buffer by libavformat. + *AVIOContext.buffer holds the buffer currently in use, + *which must be later freed with av_free(). * @param buffer_size The buffer size is very important for performance. *For protocols with fixed blocksize it should be set to this blocksize. *For others a typical size is a cache page, e.g. 4kb. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/huffyuvdec: apply vertical filter in steps of 1 line for interlaced BGRA
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 17:34:03 2014 +0100| [2f1de5ca139f185b7103caa6e5843b4fa7a78d57] | committer: Michael Niedermayer avcodec/huffyuvdec: apply vertical filter in steps of 1 line for interlaced BGRA Fixes out of array read Fixes: signal_sigsegv_3287332_2301_cov_2994954934_huffyuv.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2f1de5ca139f185b7103caa6e5843b4fa7a78d57 --- libavcodec/huffyuvdec.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index 62ed0f9..98c6128 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -1202,11 +1202,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (s->predictor == PLANE) { if (s->bitstream_bpp != 32) left[A] = 0; -if ((y & s->interlaced) == 0 && -y < s->height - 1 - s->interlaced) { +if (y < s->height - 1 - s->interlaced) { s->hdsp.add_bytes(p->data[0] + p->linesize[0] * y, p->data[0] + p->linesize[0] * y + - fake_ystride, fake_ystride); + fake_ystride, 4 * width); } } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/os_support: try to fix build when included from a c++ file like libavdevice/ decklink*cpp
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 17:07:02 2014 +0100| [d0879a93eac6ffe052e08e435141f1ae5366c4d3] | committer: Michael Niedermayer avformat/os_support: try to fix build when included from a c++ file like libavdevice/decklink*cpp Found-by: Zeranoe Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d0879a93eac6ffe052e08e435141f1ae5366c4d3 --- libavformat/os_support.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/os_support.h b/libavformat/os_support.h index 256890b..17e362b 100644 --- a/libavformat/os_support.h +++ b/libavformat/os_support.h @@ -154,7 +154,7 @@ static inline int utf8towchar(const char *filename_utf8, wchar_t **filename_w) *filename_w = NULL; return 0; } -*filename_w = av_mallocz(sizeof(wchar_t) * num_chars); +*filename_w = (wchar_t *)av_mallocz(sizeof(wchar_t) * num_chars); if (!*filename_w) { errno = ENOMEM; return -1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/jacosubdec: Cleanup when avpriv_bprint_to_extradata() fails
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 15:20:02 2014 +0100| [8cd80b5fcbfaefdb92faa8f3ed0b7f5651f38481] | committer: Michael Niedermayer avformat/jacosubdec: Cleanup when avpriv_bprint_to_extradata() fails Fixes memleaks Fixes: asan_heap-oob_4d2250_814_cov_2745172097_JACOsub_capability_tester.jss Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8cd80b5fcbfaefdb92faa8f3ed0b7f5651f38481 --- libavformat/jacosubdec.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c index 9a28870..1ca0055 100644 --- a/libavformat/jacosubdec.c +++ b/libavformat/jacosubdec.c @@ -232,7 +232,7 @@ static int jacosub_read_header(AVFormatContext *s) /* general/essential directives in the extradata */ ret = avpriv_bprint_to_extradata(st->codec, &header); if (ret < 0) -return ret; +goto fail; /* SHIFT and TIMERES affect the whole script so packet timing can only be * done in a second pass */ @@ -243,6 +243,9 @@ static int jacosub_read_header(AVFormatContext *s) ff_subtitles_queue_finalize(&jacosub->q); return 0; +fail: +jacosub_read_close(s); +return ret; } static int jacosub_read_packet(AVFormatContext *s, AVPacket *pkt) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata()
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 14:45:30 2014 +0100| [3d5d95db3f5d8e2093e9e19d0c46e86f54ed2a5d] | committer: Michael Niedermayer avcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata() Fixes out of array read Fixes: asan_heap-oob_4d2250_814_cov_2745172097_JACOsub_capability_tester.jss Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d5d95db3f5d8e2093e9e19d0c46e86f54ed2a5d --- libavcodec/utils.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index bf2a5b9..c06a733 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -3731,6 +3731,11 @@ int avpriv_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf) ret = av_bprint_finalize(buf, &str); if (ret < 0) return ret; +if (!av_bprint_is_complete(buf)) { +av_free(str); +return AVERROR(ENOMEM); +} + avctx->extradata = str; /* Note: the string is NUL terminated (so extradata can be read as a * string), but the ending character is not accounted in the size (in ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mjpegdec: Fix context fields becoming inconsistent
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 13:53:06 2014 +0100| [0eecf40935b22644e6cd74c586057237ecfd6844] | committer: Michael Niedermayer avcodec/mjpegdec: Fix context fields becoming inconsistent Fixes out of array access Fixes: asan_heap-oob_1ca4f85_2760_cov_19187_miss_congeniality_pegasus_ljpg.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0eecf40935b22644e6cd74c586057237ecfd6844 --- libavcodec/mjpegdec.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index a9569a8..f2c81e6 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1620,6 +1620,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s) } if (id == AV_RB32("LJIF")) { +int rgb = s->rgb; +int pegasus_rct = s->pegasus_rct; if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_INFO, "Pegasus lossless jpeg header found\n"); @@ -1629,17 +1631,27 @@ static int mjpeg_decode_app(MJpegDecodeContext *s) skip_bits(&s->gb, 16); /* unknown always 0? */ switch (i=get_bits(&s->gb, 8)) { case 1: -s->rgb = 1; -s->pegasus_rct = 0; +rgb = 1; +pegasus_rct = 0; break; case 2: -s->rgb = 1; -s->pegasus_rct = 1; +rgb = 1; +pegasus_rct = 1; break; default: av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace %d\n", i); } + len -= 9; +if (s->got_picture) +if (rgb != s->rgb || pegasus_rct != s->pegasus_rct) { +av_log(s->avctx, AV_LOG_WARNING, "Mismatching LJIF tag\n"); +goto out; +} + +s->rgb = rgb; +s->pegasus_rct = pegasus_rct; + goto out; } if (id == AV_RL32("colr") && len > 0) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'ca5c3ff90972a5c97aabda2ace57ba72dcd7d83b'
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 12:31:21 2014 +0100| [3fe3c8abb15a98a118b3476d6847d6a6d436399b] | committer: Michael Niedermayer Merge commit 'ca5c3ff90972a5c97aabda2ace57ba72dcd7d83b' * commit 'ca5c3ff90972a5c97aabda2ace57ba72dcd7d83b': vf_interlace: x86: improve asm performance Conflicts: libavfilter/x86/vf_interlace.asm See: 05e4b25e9b0a3586033dc21548b03c8e5071efe3 Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3fe3c8abb15a98a118b3476d6847d6a6d436399b --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vf_interlace: x86: improve asm performance
ffmpeg | branch: master | Michael Niedermayer | Sat Nov 15 04:07:08 2014 +0100| [ca5c3ff90972a5c97aabda2ace57ba72dcd7d83b] | committer: Vittorio Giovara vf_interlace: x86: improve asm performance 4775 decicycles -> 3688 decicycles > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca5c3ff90972a5c97aabda2ace57ba72dcd7d83b --- libavfilter/x86/vf_interlace.asm | 46 -- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/libavfilter/x86/vf_interlace.asm b/libavfilter/x86/vf_interlace.asm index 8c2e9b0..b8d8616 100644 --- a/libavfilter/x86/vf_interlace.asm +++ b/libavfilter/x86/vf_interlace.asm @@ -2,6 +2,7 @@ ;* x86-optimized functions for interlace filter ;* ;* Copyright (C) 2014 Kieran Kunhya +;* Copyright (c) 2014 Michael Niedermayer ;* ;* This file is part of Libav. ;* @@ -34,36 +35,27 @@ cglobal lowpass_line, 5, 5, 7 add r4, r1 neg r1 -pxor m6, m6 +pcmpeqb m6, m6 .loop -mova m0, [r2+r1] -punpcklbw m1, m0, m6 -punpckhbw m0, m6 -paddw m0, m0 -paddw m1, m1 +mova m0, [r3+r1] +mova m1, [r3+r1+mmsize] +pavgb m0, [r4+r1] +pavgb m1, [r4+r1+mmsize] +mova m2, [r2+r1] +mova m3, [r2+r1+mmsize] +pxor m0, m6 +pxor m1, m6 +pxor m2, m6, [r2+r1] +pxor m3, m6, [r2+r1+mmsize] +pavgb m0, m2 +pavgb m1, m3 +pxor m0, m6 +pxor m1, m6 +mova [r0+r1], m0 +mova [r0+r1+mmsize], m1 -mova m2, [r3+r1] -punpcklbw m3, m2, m6 -punpckhbw m2, m6 - -mova m4, [r4+r1] -punpcklbw m5, m4, m6 -punpckhbw m4, m6 - -paddw m1, m3 -pavgw m1, m5 - -paddw m0, m2 -pavgw m0, m4 - -psrlw m0, 1 -psrlw m1, 1 - -packuswb m1, m0 -mova [r0+r1], m1 - -add r1, mmsize +add r1, 2*mmsize jl .loop REP_RET %endmacro ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/x86/vf_interlace: remove redundant instructions
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 12:33:51 2014 +0100| [ca59b5b6eceb1adbf96b8248128e58bfbb79c9a6] | committer: Michael Niedermayer avfilter/x86/vf_interlace: remove redundant instructions Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca59b5b6eceb1adbf96b8248128e58bfbb79c9a6 --- libavfilter/x86/vf_interlace.asm |2 -- 1 file changed, 2 deletions(-) diff --git a/libavfilter/x86/vf_interlace.asm b/libavfilter/x86/vf_interlace.asm index 21916fd..ce3dd81 100644 --- a/libavfilter/x86/vf_interlace.asm +++ b/libavfilter/x86/vf_interlace.asm @@ -42,8 +42,6 @@ cglobal lowpass_line, 5, 5, 7 mova m1, [r3+r1+mmsize] pavgb m0, [r4+r1] pavgb m1, [r4+r1+mmsize] -mova m2, [r2+r1] -mova m3, [r2+r1+mmsize] pxor m0, m6 pxor m1, m6 pxor m2, m6, [r2+r1] ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hnm4: change width/height to int to fix hypothetical integer overflows
ffmpeg | branch: master | Michael Niedermayer | Wed Nov 12 11:13:08 2014 +0100| [57ed5a64feec4af1f16f9a74c63cfa9aa8147242] | committer: Vittorio Giovara hnm4: change width/height to int to fix hypothetical integer overflows CC: libav-sta...@libav.org Bug-Id: CID 1135770 / CID 1135771 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=57ed5a64feec4af1f16f9a74c63cfa9aa8147242 --- libavcodec/hnm4video.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/hnm4video.c b/libavcodec/hnm4video.c index 4220202..700504d 100644 --- a/libavcodec/hnm4video.c +++ b/libavcodec/hnm4video.c @@ -37,8 +37,8 @@ typedef struct Hnm4VideoContext { uint8_t version; -uint16_t width; -uint16_t height; +int width; +int height; uint8_t *current; uint8_t *previous; uint8_t *buffer1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '57ed5a64feec4af1f16f9a74c63cfa9aa8147242'
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 12:27:12 2014 +0100| [8c9945285e30ed5f7be3b29b0e24f13bde5e5b66] | committer: Michael Niedermayer Merge commit '57ed5a64feec4af1f16f9a74c63cfa9aa8147242' * commit '57ed5a64feec4af1f16f9a74c63cfa9aa8147242': hnm4: change width/height to int to fix hypothetical integer overflows See: e23b18321fb5cffb6e05d0b0ef00de9733f560da Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c9945285e30ed5f7be3b29b0e24f13bde5e5b66 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '51946d2de8bd4a4aada43b6ab41340b0f5eb4ecb'
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 12:14:12 2014 +0100| [0e85a28fa434385d6a0465bf44b95f8820683f56] | committer: Michael Niedermayer Merge commit '51946d2de8bd4a4aada43b6ab41340b0f5eb4ecb' * commit '51946d2de8bd4a4aada43b6ab41340b0f5eb4ecb': vc1: Use the correct shift amount See: a52f443714b5c2a40ed272d8445f4c39220a4b69 Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0e85a28fa434385d6a0465bf44b95f8820683f56 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '16158da9607f2f84232d3dd381406b2f2449ec74'
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 12:16:07 2014 +0100| [ba1a19bc35e4a6b9dc421feb92e3f15fa16adb8b] | committer: Michael Niedermayer Merge commit '16158da9607f2f84232d3dd381406b2f2449ec74' * commit '16158da9607f2f84232d3dd381406b2f2449ec74': hnm4: Use av_image_check_size See: e23b18321fb5cffb6e05d0b0ef00de9733f560da Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba1a19bc35e4a6b9dc421feb92e3f15fa16adb8b --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vc1: Use the correct shift amount
ffmpeg | branch: master | Michael Niedermayer | Mon Nov 24 00:44:48 2014 +0100| [51946d2de8bd4a4aada43b6ab41340b0f5eb4ecb] | committer: Vittorio Giovara vc1: Use the correct shift amount `is_intra` is a 6bits bitfield. CC: libav-sta...@libav.org Bug-Id: CID 1194380 / CID 1194381 Signed-off-by: Luca Barbato > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=51946d2de8bd4a4aada43b6ab41340b0f5eb4ecb --- libavcodec/vc1_loopfilter.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/vc1_loopfilter.c b/libavcodec/vc1_loopfilter.c index 1b76d83..78a5d65 100644 --- a/libavcodec/vc1_loopfilter.c +++ b/libavcodec/vc1_loopfilter.c @@ -224,14 +224,14 @@ static av_always_inline void vc1_apply_p_v_loop_filter(VC1Context *v, int block_ if (block_num > 3) { bottom_cbp = v->cbp[s->mb_x] >> (block_num * 4); -bottom_is_intra = v->is_intra[s->mb_x] >> (block_num * 4); +bottom_is_intra = v->is_intra[s->mb_x] >> block_num; mv = &v->luma_mv[s->mb_x - s->mb_stride]; mv_stride = s->mb_stride; } else { bottom_cbp = (block_num < 2) ? (mb_cbp >> ((block_num + 2) * 4)) : (v->cbp[s->mb_x] >> ((block_num - 2) * 4)); -bottom_is_intra = (block_num < 2) ? (mb_is_intra >> ((block_num + 2) * 4)) - : (v->is_intra[s->mb_x] >> ((block_num - 2) * 4)); +bottom_is_intra = (block_num < 2) ? (mb_is_intra >> (block_num + 2)) + : (v->is_intra[s->mb_x] >> (block_num - 2)); mv_stride = s->b8_stride; mv = &s->current_picture.motion_val[0][s->block_index[block_num] - 2 * mv_stride]; } @@ -273,7 +273,7 @@ static av_always_inline void vc1_apply_p_h_loop_filter(VC1Context *v, int block_ int mb_cbp = v->cbp[s->mb_x - 1 - s->mb_stride], block_cbp = mb_cbp >> (block_num * 4), right_cbp, mb_is_intra= v->is_intra[s->mb_x - 1 - s->mb_stride], -block_is_intra = mb_is_intra >> (block_num * 4), right_is_intra; +block_is_intra = mb_is_intra >> block_num, right_is_intra; int idx, linesize = block_num > 3 ? s->uvlinesize : s->linesize, ttblk; uint8_t *dst; @@ -288,13 +288,13 @@ static av_always_inline void vc1_apply_p_h_loop_filter(VC1Context *v, int block_ if (block_num > 3) { right_cbp = v->cbp[s->mb_x - s->mb_stride] >> (block_num * 4); -right_is_intra = v->is_intra[s->mb_x - s->mb_stride] >> (block_num * 4); +right_is_intra = v->is_intra[s->mb_x - s->mb_stride] >> block_num; mv = &v->luma_mv[s->mb_x - s->mb_stride - 1]; } else { right_cbp = (block_num & 1) ? (v->cbp[s->mb_x - s->mb_stride] >> ((block_num - 1) * 4)) : (mb_cbp >> ((block_num + 1) * 4)); -right_is_intra = (block_num & 1) ? (v->is_intra[s->mb_x - s->mb_stride] >> ((block_num - 1) * 4)) - : (mb_is_intra >> ((block_num + 1) * 4)); +right_is_intra = (block_num & 1) ? (v->is_intra[s->mb_x - s->mb_stride] >> (block_num - 1)) + : (mb_is_intra >> (block_num + 1)); mv = &s->current_picture.motion_val[0][s->block_index[block_num] - s->b8_stride * 2 - 2]; } if (block_is_intra & 1 || right_is_intra & 1 || mv[0][0] != mv[1][0] || mv[0][1] != mv[1][1]) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hnm4: Use av_image_check_size
ffmpeg | branch: master | Luca Barbato | Mon Nov 24 01:04:39 2014 +0100| [16158da9607f2f84232d3dd381406b2f2449ec74] | committer: Vittorio Giovara hnm4: Use av_image_check_size As done for all the other codecs not calling it indirectly. CC: libav-sta...@libav.org Bug-Id: CID 1135770 / CID 1135771 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=16158da9607f2f84232d3dd381406b2f2449ec74 --- libavcodec/hnm4video.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/hnm4video.c b/libavcodec/hnm4video.c index b200e89..4220202 100644 --- a/libavcodec/hnm4video.c +++ b/libavcodec/hnm4video.c @@ -22,6 +22,7 @@ #include +#include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" @@ -406,6 +407,7 @@ static int hnm_decode_frame(AVCodecContext *avctx, void *data, static av_cold int hnm_decode_init(AVCodecContext *avctx) { Hnm4VideoContext *hnm = avctx->priv_data; +int ret; if (avctx->extradata_size < 1) { av_log(avctx, AV_LOG_ERROR, @@ -413,6 +415,10 @@ static av_cold int hnm_decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } +ret = av_image_check_size(avctx->width, avctx->height, 0, avctx); +if (ret < 0) +return ret; + hnm->version = avctx->extradata[0]; avctx->pix_fmt = AV_PIX_FMT_PAL8; hnm->width = avctx->width; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'd25afb579facc83fd3a839f21411124d0b09f0ba'
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 11:57:57 2014 +0100| [79f77ce31c6cbe2c8c1163862acdaf2014a85458] | committer: Michael Niedermayer Merge commit 'd25afb579facc83fd3a839f21411124d0b09f0ba' * commit 'd25afb579facc83fd3a839f21411124d0b09f0ba': vc1: Set the is_intra bitfield to all 1 when needed Conflicts: libavcodec/vc1_block.c See: 04152a31cb41a7ca3cc0bde9d962454fc30bab9c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=79f77ce31c6cbe2c8c1163862acdaf2014a85458 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vc1: Set the is_intra bitfield to all 1 when needed
ffmpeg | branch: master | Luca Barbato | Mon Nov 24 00:44:47 2014 +0100| [d25afb579facc83fd3a839f21411124d0b09f0ba] | committer: Vittorio Giovara vc1: Set the is_intra bitfield to all 1 when needed Keep the code as similar as possible across the codepaths to ease spotting it for factorization. Based on a patch from Michael Niedermayer . > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d25afb579facc83fd3a839f21411124d0b09f0ba --- libavcodec/vc1_block.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index ab7f7a3..38de670 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -1648,8 +1648,9 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) s->current_picture.motion_val[1][s->block_index[i]][0] = 0; s->current_picture.motion_val[1][s->block_index[i]][1] = 0; } -s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; -s->mb_intra = v->is_intra[s->mb_x] = 1; +v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. +s->mb_intra = 1; +s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); mb_has_coeffs = get_bits1(gb); if (mb_has_coeffs) @@ -1816,7 +1817,8 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_IF_MBMODE_VLC_BITS, 2); if (idx_mbmode <= 1) { // intra MB -s->mb_intra = v->is_intra[s->mb_x] = 1; +v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. +s->mb_intra = 1; s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; @@ -2093,7 +2095,8 @@ static void vc1_decode_b_mb_intfi(VC1Context *v) idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_IF_MBMODE_VLC_BITS, 2); if (idx_mbmode <= 1) { // intra MB -s->mb_intra = v->is_intra[s->mb_x] = 1; +v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. +s->mb_intra = 1; s->current_picture.motion_val[1][s->block_index[0]][0] = 0; s->current_picture.motion_val[1][s->block_index[0]][1] = 0; s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; @@ -2311,8 +2314,9 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = 0; s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = 0; } +v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. +s->mb_intra = 1; s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; -s->mb_intra = v->is_intra[s->mb_x] = 1; fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); mb_has_coeffs = get_bits1(gb); if (mb_has_coeffs) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vorbis_parser: Move vp check to avoid a null pointer dereference
ffmpeg | branch: master | Michael Niedermayer | Mon Nov 24 15:48:27 2014 +| [62e52b94e684491dfc5a6b7ca688bb86f7cd0f3f] | committer: Vittorio Giovara vorbis_parser: Move vp check to avoid a null pointer dereference CC: libav-sta...@libav.org Bug-Id: CID 1251347 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=62e52b94e684491dfc5a6b7ca688bb86f7cd0f3f --- libavcodec/vorbis_parser.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/vorbis_parser.c b/libavcodec/vorbis_parser.c index 231706c..054635d 100644 --- a/libavcodec/vorbis_parser.c +++ b/libavcodec/vorbis_parser.c @@ -303,9 +303,9 @@ static int vorbis_parse(AVCodecParserContext *s1, AVCodecContext *avctx, if (!s->vp && avctx->extradata && avctx->extradata_size) { s->vp = av_vorbis_parse_init(avctx->extradata, avctx->extradata_size); -if (!s->vp) -goto end; } +if (!s->vp) +goto end; if ((duration = av_vorbis_parse_frame(s->vp, buf, buf_size)) >= 0) s1->duration = duration; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '62e52b94e684491dfc5a6b7ca688bb86f7cd0f3f'
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 11:19:31 2014 +0100| [bcccb2c2986bca9307b66a8d681addad54c786ff] | committer: Michael Niedermayer Merge commit '62e52b94e684491dfc5a6b7ca688bb86f7cd0f3f' * commit '62e52b94e684491dfc5a6b7ca688bb86f7cd0f3f': vorbis_parser: Move vp check to avoid a null pointer dereference See: 374c907fb35f8236547b24d792fbb9bed201e321 Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bcccb2c2986bca9307b66a8d681addad54c786ff --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'c117da9d3e0db7dc311d817054988364b3ef4587'
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 11:17:50 2014 +0100| [a63ec9d5737a79ea78e781f90405e5bef4326468] | committer: Michael Niedermayer Merge commit 'c117da9d3e0db7dc311d817054988364b3ef4587' * commit 'c117da9d3e0db7dc311d817054988364b3ef4587': lpc: remove unneeded {} See: 85929b9caa90553f9e1bbd7a3ead03ef2ade4d71 Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a63ec9d5737a79ea78e781f90405e5bef4326468 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vc1: Simplify a little setting the intra variables
ffmpeg | branch: master | Luca Barbato | Mon Nov 24 00:44:46 2014 +0100| [b67138598ce158e3083f6295a27b63e2065d5ecb] | committer: Vittorio Giovara vc1: Simplify a little setting the intra variables The code currently set the information in at least 4 places, spare some pointless loops. Make the code in the loop a little uniform to make easier factorize it out later. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b67138598ce158e3083f6295a27b63e2065d5ecb --- libavcodec/vc1_block.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index acd5145..ab7f7a3 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -1650,8 +1650,6 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) } s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; s->mb_intra = v->is_intra[s->mb_x] = 1; -for (i = 0; i < 6; i++) -v->mb_type[0][s->block_index[i]] = 1; fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); mb_has_coeffs = get_bits1(gb); if (mb_has_coeffs) @@ -1664,11 +1662,11 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) s->c_dc_scale = s->c_dc_scale_table[mquant]; dst_idx = 0; for (i = 0; i < 6; i++) { -s->dc_val[0][s->block_index[i]] = 0; +v->a_avail = v->c_avail = 0; +v->mb_type[0][s->block_index[i]] = 1; +s->dc_val[0][s->block_index[i]] = 0; dst_idx += i >> 2; val = ((cbp >> (5 - i)) & 1); -v->mb_type[0][s->block_index[i]] = s->mb_intra; -v->a_avail = v->c_avail = 0; if (i == 2 || i == 3 || !s->first_slice_line) v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]]; if (i == 1 || i == 3 || s->mb_x) @@ -1833,11 +1831,11 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_ICBPCY_VLC_BITS, 2); dst_idx = 0; for (i = 0; i < 6; i++) { -s->dc_val[0][s->block_index[i]] = 0; +v->a_avail = v->c_avail = 0; v->mb_type[0][s->block_index[i]] = 1; +s->dc_val[0][s->block_index[i]] = 0; dst_idx += i >> 2; val = ((cbp >> (5 - i)) & 1); -v->a_avail = v->c_avail = 0; if (i == 2 || i == 3 || !s->first_slice_line) v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]]; if (i == 1 || i == 3 || s->mb_x) @@ -2110,11 +2108,11 @@ static void vc1_decode_b_mb_intfi(VC1Context *v) cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_ICBPCY_VLC_BITS, 2); dst_idx = 0; for (i = 0; i < 6; i++) { -s->dc_val[0][s->block_index[i]] = 0; +v->a_avail = v->c_avail = 0; +v->mb_type[0][s->block_index[i]] = 1; +s->dc_val[0][s->block_index[i]] = 0; dst_idx += i >> 2; val = ((cbp >> (5 - i)) & 1); -v->mb_type[0][s->block_index[i]] = s->mb_intra; -v->a_avail = v->c_avail = 0; if (i == 2 || i == 3 || !s->first_slice_line) v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]]; if (i == 1 || i == 3 || s->mb_x) @@ -2315,8 +2313,6 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) } s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; s->mb_intra = v->is_intra[s->mb_x] = 1; -for (i = 0; i < 6; i++) -v->mb_type[0][s->block_index[i]] = 1; fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); mb_has_coeffs = get_bits1(gb); if (mb_has_coeffs) @@ -2329,11 +2325,11 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) s->c_dc_scale = s->c_dc_scale_table[mquant]; dst_idx = 0; for (i = 0; i < 6; i++) { -s->dc_val[0][s->block_index[i]] = 0; +v->a_avail = v->c_avail = 0; +v->mb_type[0][s->block_index[i]] = 1; +s->dc_val[0][s->block_index[i]] = 0; dst_idx += i >> 2; val = ((cbp >> (5 - i)) & 1); -v->mb_type[0][s->block_index[i]] = s->mb_intra; -v->a_avail = v->c_avail = 0; if (i == 2 || i == 3 || !s->first_slice_line) v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]]; if (i == 1 || i == 3 || s->mb_x) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lpc: remove unneeded {}
ffmpeg | branch: master | Michael Niedermayer | Mon Nov 24 16:06:00 2014 +| [c117da9d3e0db7dc311d817054988364b3ef4587] | committer: Vittorio Giovara lpc: remove unneeded {} Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c117da9d3e0db7dc311d817054988364b3ef4587 --- libavcodec/lpc.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h index 6b3f80e..642854c 100644 --- a/libavcodec/lpc.h +++ b/libavcodec/lpc.h @@ -152,7 +152,7 @@ static inline int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order, int normalize) { int i, j; -LPC_TYPE err = { 0 }; +LPC_TYPE err = 0; LPC_TYPE *lpc_last = lpc; if (normalize) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'b67138598ce158e3083f6295a27b63e2065d5ecb'
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 11:33:51 2014 +0100| [ed25ca16617121b382a961980707844fafcf82f8] | committer: Michael Niedermayer Merge commit 'b67138598ce158e3083f6295a27b63e2065d5ecb' * commit 'b67138598ce158e3083f6295a27b63e2065d5ecb': vc1: Simplify a little setting the intra variables Conflicts: libavcodec/vc1_block.c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed25ca16617121b382a961980707844fafcf82f8 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vc1pred: remove logically dead code
ffmpeg | branch: master | Vittorio Giovara | Mon Nov 24 01:38:53 2014 +| [bc75b64cff37d58f3944e2da3da45c37f35f019a] | committer: Vittorio Giovara vc1pred: remove logically dead code CC: libav-sta...@libav.org Bug-Id: CID 1245699 / CID 1245700 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc75b64cff37d58f3944e2da3da45c37f35f019a --- libavcodec/vc1_pred.c |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavcodec/vc1_pred.c b/libavcodec/vc1_pred.c index 6a54fe4..07e9d91 100644 --- a/libavcodec/vc1_pred.c +++ b/libavcodec/vc1_pred.c @@ -648,7 +648,7 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, } else if (c_valid) { px = C[0]; py = C[1]; -} else px = py = 0; +} } else { if (field_a && a_valid) { px = A[0]; @@ -656,11 +656,7 @@ void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, } else if (field_b && b_valid) { px = B[0]; py = B[1]; -} else if (c_valid) { -px = C[0]; -py = C[1]; -} else -px = py = 0; +} } } else if (total_valid == 1) { px = (a_valid) ? A[0] : ((b_valid) ? B[0] : C[0]); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'bc75b64cff37d58f3944e2da3da45c37f35f019a'
ffmpeg | branch: master | Michael Niedermayer | Tue Nov 25 11:00:50 2014 +0100| [0aa208837e247d0e031755e031202e567c5e82fb] | committer: Michael Niedermayer Merge commit 'bc75b64cff37d58f3944e2da3da45c37f35f019a' * commit 'bc75b64cff37d58f3944e2da3da45c37f35f019a': vc1pred: remove logically dead code Conflicts: libavcodec/vc1_pred.c See: fca435fee167da981f024e35d9fef4e6179b8061 Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0aa208837e247d0e031755e031202e567c5e82fb --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
Re: [FFmpeg-cvslog] lavf: Use wchar functions for filenames on windows for mkdir/rmdir/rename/ unlink
On 25.11.2014, at 09:07, Reimar Döffinger wrote: > On 25.11.2014, at 04:04, g...@videolan.org (Martin Storsjö) wrote: >> ffmpeg | branch: master | Martin Storsjö | Mon Nov 17 >> 23:08:15 2014 +0200| [960aff379da46dcaff61504a57714d4d4e758e41] | committer: >> Martin Storsjö >> >> lavf: Use wchar functions for filenames on windows for >> mkdir/rmdir/rename/unlink > > I don't think we should fall back to the CP_ACP case if the conversion failed > with ENOMEM. Forget that, I fail at reading. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
Re: [FFmpeg-cvslog] lavf: Use wchar functions for filenames on windows for mkdir/rmdir/rename/ unlink
On 25.11.2014, at 04:04, g...@videolan.org (Martin Storsjö) wrote: > ffmpeg | branch: master | Martin Storsjö | Mon Nov 17 > 23:08:15 2014 +0200| [960aff379da46dcaff61504a57714d4d4e758e41] | committer: > Martin Storsjö > > lavf: Use wchar functions for filenames on windows for > mkdir/rmdir/rename/unlink I don't think we should fall back to the CP_ACP case if the conversion failed with ENOMEM. Also, don't we already have a utf8 to multibyte conversion we used for e.g. open() somewhere we should try to reuse? > +*filename_w = av_mallocz(sizeof(wchar_t) * num_chars); Nit: don't we usually prefer sizeof(**filename) over sizeof(type)? ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog