[FFmpeg-cvslog] avdevice/decklink: Fix build error caused by a change in the SDK.
ffmpeg | branch: master | Chris Spencer | Sun Jul 19 20:32:49 2015 +0100| [9c41126e1b9f8c625cba20164ab7d48c075f6923] | committer: Michael Niedermayer avdevice/decklink: Fix build error caused by a change in the SDK. In version 10.4 of the DeckLink SDK, GetBufferedAudioSampleFrameCount() was changed to take an unsigned int instead of an unsigned long. Signed-off-by: Chris Spencer Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9c41126e1b9f8c625cba20164ab7d48c075f6923 --- libavdevice/decklink_common.h |6 ++ 1 file changed, 6 insertions(+) diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h index 96912a7..3bc30f0 100644 --- a/libavdevice/decklink_common.h +++ b/libavdevice/decklink_common.h @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "decklink_common_c.h" class decklink_output_callback; @@ -82,7 +84,11 @@ struct decklink_ctx { typedef enum { DIRECTION_IN, DIRECTION_OUT} decklink_direction_t; #ifdef _WIN32 +#if BLACKMAGIC_DECKLINK_API_VERSION < 0x0a04 typedef unsigned long buffercount_type; +#else +typedef unsigned int buffercount_type; +#endif IDeckLinkIterator *CreateDeckLinkIteratorInstance(void); #else typedef uint32_t buffercount_type; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Update for 2.5.8
ffmpeg | branch: release/2.5 | Michael Niedermayer | Tue Jul 28 03:23:43 2015 +0200| [ad03cef4208b564f63354cdce6610e854cd51a48] | committer: Michael Niedermayer Update for 2.5.8 Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad03cef4208b564f63354cdce6610e854cd51a48 --- Changelog| 89 ++ RELEASE |2 +- doc/Doxyfile |2 +- 3 files changed, 91 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 9c37fac..9cfeeff 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,95 @@ Entries are sorted chronologically from oldest to youngest within each release, releases are sorted from youngest to oldest. +version 2.5.8 +- avcodec/vp8: Check buffer size in vp8_decode_frame_header() +- avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free() +- avcodec/diracdec: Check for hpel_base allocation failure +- avcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy() +- avfilter/af_aresample: Check ff_all_* for allocation failures +- avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case +- swscale/utils: Clear pix buffers +- avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write() +- avformat/mov: Fix deallocation when MOVStreamContext failed to allocate +- ffmpeg: Fix crash with ost->last_frame allocation failure +- ffmpeg: Fix cleanup with ost = NULL +- avcodec/pthread_frame: check avctx on deallocation +- avcodec/sanm: Reset sizes in destroy_buffers() +- avcodec/alac: Clear pointers in allocate_buffers() +- bytestream2: set the reader to the end when reading more than available +- avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264 +- avcodec/mpegvideo: Clear pointers in ff_mpv_common_init() +- oggparsedirac: check return value of init_get_bits +- wmalosslessdec: reset frame->nb_samples on packet loss +- wmalosslessdec: avoid reading 0 bits with get_bits +- avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2() +- avcodec/aacsbr: Assert that bs_num_env is positive +- avcodec/aacsbr: check that the element type matches before applying SBR +- avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h +- vp9/update_prob: prevent out of bounds table read +- avfilter/vf_transpose: Fix rounding error +- avcodec/pngdec: Check values before updating context in decode_fctl_chunk() +- avcodec/pngdec: Require a IHDR chunk before fctl +- avcodec/pngdec: Only allow one IHDR chunk +- wmavoice: limit wmavoice_decode_packet return value to packet size +- swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian +- ffmpeg: Do not use the data/size of a bitstream filter after failure +- swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext} +- swscale/x86/rgb2rgb_template: add missing xmm clobbers +- vda: unlock the pixel buffer base address. +- swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c() +- swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE +- swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian +- swr: Remember previously set int_sample_format from user +- matroskadec: check audio sample rate +- matroskadec: validate audio channels and bitdepth +- avcodec/dpxenc: implement write16/32 as functions +- postproc: fix unaligned access +- ffmpeg: Free last_frame instead of just unref +- avio: fix potential crashes when combining ffio_ensure_seekback + crc +- h264: er: Copy from the previous reference only if compatible +- sonic: set avctx->channels in sonic_decode_init +- vp8: change mv_{min,max}.{x,y} type to int +- vp9: change type of tile_size from unsigned to int64_t +- arm: only enable setend on ARMv6 +- libopenjpegdec: check existence of image component data +- mov: abort on EOF in ff_mov_read_chan +- ffmpeg_opt: Check for localtime() failure +- avformat: Fix bug in parse_rps for HEVC. +- takdec: ensure chan2 is a valid channel index +- avcodec/h264_slice: Use AVFrame diemensions for grayscale handling +- avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet() +- libavutil/channel_layout: Correctly return layout when channel specification ends with a trailing 'c'. +- avcodec/jpeg2000dec: Check that coords match before applying ICT +- avformat/ffmdec: Check ffio_set_buf_size() return value +- avcodec/adpcm: Check for overreads +- avcodec/alsdec: Check for overread +- avcodec/atrac3plusdec: consume only as many bytes as available +- libavutil/softfloat: Fix av_normalize1_sf bias. +- swresample/swresample: Cleanup on init failure. +- Revert "avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr dereference" +- avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec +- swresample/dither: check memory allocation +- libopenjpegenc: add NULL check for img before accessing it +- swresam
[FFmpeg-cvslog] ffmpeg: Fix cleanup with ost = NULL
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jul 13 23:33:18 2015 +0200| [3e167497c78f0f562fa6b5d05977bf3028ad8780] | committer: Michael Niedermayer ffmpeg: Fix cleanup with ost = NULL Fixes: 09e670595acbdafb226974b08dab66e3_signal_sigabrt_770eccc9_991_xtrem_e2_m64q15_a32sxx.3gp with memlimit of 1048576 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 503ec7139f887bf8ed8d57da07ce93c4e88447a6) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3e167497c78f0f562fa6b5d05977bf3028ad8780 --- ffmpeg.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ffmpeg.c b/ffmpeg.c index 0636304..baaa101 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -466,7 +466,12 @@ static void ffmpeg_cleanup(int ret) } for (i = 0; i < nb_output_streams; i++) { OutputStream *ost = output_streams[i]; -AVBitStreamFilterContext *bsfc = ost->bitstream_filters; +AVBitStreamFilterContext *bsfc; + +if (!ost) +continue; + +bsfc = ost->bitstream_filters; while (bsfc) { AVBitStreamFilterContext *next = bsfc->next; av_bitstream_filter_close(bsfc); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()
ffmpeg | branch: release/2.5 | Zhang Rui | Tue Jul 14 14:47:26 2015 +0800| [d819a2c9869cacfc58ab7ef55bf74532bd6dad20] | committer: Michael Niedermayer avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write() Signed-off-by: Michael Niedermayer (cherry picked from commit fcbea93cf8777bbef2a393d26942b5d3c70a448d) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d819a2c9869cacfc58ab7ef55bf74532bd6dad20 --- libavutil/fifo.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavutil/fifo.c b/libavutil/fifo.c index 4ff3194..f2fe93d 100644 --- a/libavutil/fifo.c +++ b/libavutil/fifo.c @@ -129,7 +129,8 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, do { int len = FFMIN(f->end - wptr, size); if (func) { -if (func(src, wptr, len) <= 0) +len = func(src, wptr, len); +if (len <= 0) break; } else { memcpy(wptr, src, len); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case
ffmpeg | branch: release/2.5 | Michael Niedermayer | Thu Jul 16 11:52:33 2015 +0200| [b7c8d072ea1bde2edd8f2b1b83d3463b6ca4c844] | committer: Michael Niedermayer avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case Fixes: b4b47bc2b3fb7ca710bfffe5aa969e37_signal_sigabrt_770eccc9_744_nc_sample2.avi with memlimit of 4194304 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit f1a38264f20382731cf2cc75fdd98f4c9a84a626) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b7c8d072ea1bde2edd8f2b1b83d3463b6ca4c844 --- libavcodec/pthread_frame.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index e7ac377..41fafce 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -669,6 +669,7 @@ int ff_frame_thread_init(AVCodecContext *avctx) copy->internal = av_malloc(sizeof(AVCodecInternal)); if (!copy->internal) { +copy->priv_data = NULL; err = AVERROR(ENOMEM); goto error; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: Do not use the data/size of a bitstream filter after failure
ffmpeg | branch: release/2.5 | Michael Niedermayer | Wed Jun 24 13:27:39 2015 +0200| [98d916300afeb5291f2a8eb8c0deb9fc33f545dc] | committer: Michael Niedermayer ffmpeg: Do not use the data/size of a bitstream filter after failure Found-by: Rodger Combs Signed-off-by: Michael Niedermayer (cherry picked from commit 8f0f678f090d9939b0014ba85641e2cb83d39cb8) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98d916300afeb5291f2a8eb8c0deb9fc33f545dc --- ffmpeg.c |1 + 1 file changed, 1 insertion(+) diff --git a/ffmpeg.c b/ffmpeg.c index 60d8e89..0636304 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -650,6 +650,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost) if (!new_pkt.buf) exit_program(1); } else if (a < 0) { +new_pkt = *pkt; av_log(NULL, AV_LOG_ERROR, "Failed to open bitstream filter %s for stream %d with codec %s", bsfc->filter->name, pkt->stream_index, avctx->codec ? avctx->codec->name : "copy"); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/utils: Clear pix buffers
ffmpeg | branch: release/2.5 | Michael Niedermayer | Wed Jul 15 19:20:19 2015 +0200| [46236b0bae230df903e9c4ebaa79d14ddd7dd303] | committer: Michael Niedermayer swscale/utils: Clear pix buffers Fixes use of uninitialized memory Fixes: a96874b9466b6edc660a519c7ad47977_signal_sigsegv_7713351a_744_nc_sample.avi with memlimit 2147483648 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit a5d44d5c220e12ca0cb7a4eceb0f74759cb13111) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46236b0bae230df903e9c4ebaa79d14ddd7dd303 --- libswscale/utils.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index fd8e72a..475c3ed 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1410,9 +1410,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, /* Allocate pixbufs (we use dynamic allocation because otherwise we would * need to allocate several megabytes to handle all possible cases) */ -FF_ALLOC_OR_GOTO(c, c->lumPixBuf, c->vLumBufSize * 3 * sizeof(int16_t *), fail); -FF_ALLOC_OR_GOTO(c, c->chrUPixBuf, c->vChrBufSize * 3 * sizeof(int16_t *), fail); -FF_ALLOC_OR_GOTO(c, c->chrVPixBuf, c->vChrBufSize * 3 * sizeof(int16_t *), fail); +FF_ALLOCZ_OR_GOTO(c, c->lumPixBuf, c->vLumBufSize * 3 * sizeof(int16_t *), fail); +FF_ALLOCZ_OR_GOTO(c, c->chrUPixBuf, c->vChrBufSize * 3 * sizeof(int16_t *), fail); +FF_ALLOCZ_OR_GOTO(c, c->chrVPixBuf, c->vChrBufSize * 3 * sizeof(int16_t *), fail); if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat) && isALPHA(c->dstFormat)) FF_ALLOCZ_OR_GOTO(c, c->alpPixBuf, c->vLumBufSize * 3 * sizeof(int16_t *), fail); /* Note we need at least one pixel more at the end because of the MMX code ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/vp8: Check buffer size in vp8_decode_frame_header()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Sat Jul 18 19:18:24 2015 +0200| [be369f6e4034bee7630ea70d7b516bdee25ff40f] | committer: Michael Niedermayer avcodec/vp8: Check buffer size in vp8_decode_frame_header() avoids null pointer dereference Fixes: signal_sigsegv_d5de40_964_vp80-00-comprehensive-010.ivf with memlimit of 1048576 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 599d746e07319dc792ed2e511b666fe482f1ff88) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be369f6e4034bee7630ea70d7b516bdee25ff40f --- libavcodec/vp8.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 8313544..944db5e 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -639,6 +639,11 @@ static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si int width = s->avctx->width; int height = s->avctx->height; +if (buf_size < 3) { +av_log(s->avctx, AV_LOG_ERROR, "Insufficent data (%d) for header\n", buf_size); +return AVERROR_INVALIDDATA; +} + s->keyframe = !(buf[0] & 1); s->profile = (buf[0]>>1) & 7; s->invisible = !(buf[0] & 0x10); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jun 1 21:35:02 2015 +0200| [f569422d669ff2232e52ee4345eea0742d37c67c] | committer: Michael Niedermayer avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec This is the maximum rate possible based on the frame size limit of MXF D-10 Previous version reviewed by tim nicholson Signed-off-by: Michael Niedermayer (cherry picked from commit d7a762553c6f6c422adb6632354bcc4ff577b701) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f569422d669ff2232e52ee4345eea0742d37c67c --- libavformat/mxfenc.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index a850239..36503f3 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1840,9 +1840,10 @@ static int mxf_write_header(AVFormatContext *s) return ret; sc->video_bit_rate = st->codec->bit_rate ? st->codec->bit_rate : st->codec->rc_max_rate; if (s->oformat == &ff_mxf_d10_muxer) { -if (sc->video_bit_rate == 5000) { -if (mxf->time_base.den == 25) sc->index = 3; -else sc->index = 5; +if ((sc->video_bit_rate == 5000) && (mxf->time_base.den == 25)) { +sc->index = 3; +} else if ((sc->video_bit_rate == 4840 || sc->video_bit_rate == 5000) && (mxf->time_base.den != 25)) { +sc->index = 5; } else if (sc->video_bit_rate == 4000) { if (mxf->time_base.den == 25) sc->index = 7; else sc->index = 9; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Sat Jul 18 11:24:45 2015 +0200| [8696762b9a3b66b7dac4bd7b8022a4ba0f72153a] | committer: Michael Niedermayer avcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy() Avoids leaving stale pointers Fixes: signal_sigabrt_770eccc9_819_sabtriple.rm with memlimit 536870912 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 3197c0aa87a3b7190e17d49e6fbc7b554e4b3f0a) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8696762b9a3b66b7dac4bd7b8022a4ba0f72153a --- libavcodec/rv34.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index a232ab2..6e86ebd 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -1534,7 +1534,14 @@ int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx) if (avctx->internal->is_copy) { r->tmp_b_block_base = NULL; +r->cbp_chroma = NULL; +r->cbp_luma = NULL; +r->deblock_coefs= NULL; +r->intra_types_hist = NULL; +r->mb_type = NULL; + ff_mpv_idct_init(&r->s); + if ((err = ff_mpv_common_init(&r->s)) < 0) return err; if ((err = rv34_decoder_alloc(r)) < 0) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pthread_frame: check avctx on deallocation
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jul 13 21:19:04 2015 +0200| [95d8912bfdc5e0eca54d9f3b251f67c19b88b6a3] | committer: Michael Niedermayer avcodec/pthread_frame: check avctx on deallocation Fixes null pointer dereferences Fixes: af1a5a33e67e479f439239097bd0d4fd_signal_sigsegv_7713351a_152_Dolby_Rain_Logo.pmp with memlimit of 8388608 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 5d346feafa817c4fbc30f7ed0b93b2dad6cef15b) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=95d8912bfdc5e0eca54d9f3b251f67c19b88b6a3 --- libavcodec/pthread_frame.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 5a4ab84..e7ac377 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -571,7 +571,7 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count) pthread_join(p->thread, NULL); p->thread_init=0; -if (codec->close) +if (codec->close && p->avctx) codec->close(p->avctx); avctx->codec = NULL; @@ -591,12 +591,13 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count) av_packet_unref(&p->avpkt); av_freep(&p->released_buffers); -if (i) { +if (i && p->avctx) { av_freep(&p->avctx->priv_data); av_freep(&p->avctx->slice_offset); } -av_freep(&p->avctx->internal); +if (p->avctx) +av_freep(&p->avctx->internal); av_freep(&p->avctx); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/diracdec: Check for hpel_base allocation failure
ffmpeg | branch: release/2.5 | Michael Niedermayer | Sat Jul 18 17:55:19 2015 +0200| [c72c1b871602079f4d867bf5c04fa0a3f51ec7c2] | committer: Michael Niedermayer avcodec/diracdec: Check for hpel_base allocation failure Fixes null pointer dereference Fixes: signal_sigsegv_b02a96_280_RL_420p_ffdirac.drc with memlimit of 67108864 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 1c5b712c0a643a039d6f34269b4102de313a050a) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c72c1b871602079f4d867bf5c04fa0a3f51ec7c2 --- libavcodec/diracdec.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 1bfe6be..6b93d86 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1561,7 +1561,7 @@ static void select_dsp_funcs(DiracContext *s, int width, int height, int xblen, } } -static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height) +static int interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, int width, int height) { /* chroma allocates an edge of 8 when subsampled which for 4:2:2 means an h edge of 16 and v edge of 8 @@ -1573,11 +1573,14 @@ static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, in /* no need for hpel if we only have fpel vectors */ if (!s->mv_precision) -return; +return 0; for (i = 1; i < 4; i++) { if (!ref->hpel_base[plane][i]) ref->hpel_base[plane][i] = av_malloc((height+2*edge) * ref->avframe->linesize[plane] + 32); +if (!ref->hpel_base[plane][i]) { +return AVERROR(ENOMEM); +} /* we need to be 16-byte aligned even for chroma */ ref->hpel[plane][i] = ref->hpel_base[plane][i] + edge*ref->avframe->linesize[plane] + 16; } @@ -1591,6 +1594,8 @@ static void interpolate_refplane(DiracContext *s, DiracFrame *ref, int plane, in s->mpvencdsp.draw_edges(ref->hpel[plane][3], ref->avframe->linesize[plane], width, height, edge, edge, EDGE_TOP | EDGE_BOTTOM); } ref->interpolated[plane] = 1; + +return 0; } /** @@ -1640,8 +1645,11 @@ static int dirac_decode_frame_internal(DiracContext *s) select_dsp_funcs(s, p->width, p->height, p->xblen, p->yblen); -for (i = 0; i < s->num_refs; i++) -interpolate_refplane(s, s->ref_pics[i], comp, p->width, p->height); +for (i = 0; i < s->num_refs; i++) { +int ret = interpolate_refplane(s, s->ref_pics[i], comp, p->width, p->height); +if (ret < 0) +return ret; +} memset(s->mctmp, 0, 4*p->yoffset*p->stride); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Sat Jul 18 19:02:26 2015 +0200| [1166d9245ab1ee76905a8ec7355a7f03f611ed83] | committer: Michael Niedermayer avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free() Fixes: signal_sigsegv_d5de23_967_vp80_00_comprehensive_010.ivf with memlimit 524288 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit a84f0e8d8f293df3c535f9b893730a835bed6520) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1166d9245ab1ee76905a8ec7355a7f03f611ed83 --- libavcodec/vp8.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 86eb4e9..8313544 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -2689,6 +2689,9 @@ av_cold int ff_vp8_decode_free(AVCodecContext *avctx) VP8Context *s = avctx->priv_data; int i; +if (!s) +return 0; + vp8_decode_flush_impl(avctx, 1); for (i = 0; i < FF_ARRAY_ELEMS(s->frames); i++) av_frame_free(&s->frames[i].tf.f); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pngdec: Only allow one IHDR chunk
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jun 29 21:08:05 2015 +0200| [d661cfad02afc2f8cb17d5b89c1aced1189dab82] | committer: Michael Niedermayer avcodec/pngdec: Only allow one IHDR chunk Multiple IHDR chunks are forbidden in PNG Fixes inconsistency and out of array accesses Fixes: asan_heap-oob_4d5c5a_1738_cov_2638287726_c-m2-8f2b481b7fd9bd745e620b7c01a18df2.png Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 47f4e2d8960ca756ca153ab8e3e93d80449b8c91) Conflicts: libavcodec/pngdec.c Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d661cfad02afc2f8cb17d5b89c1aced1189dab82 --- libavcodec/pngdec.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 75feb04..092528e 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -538,6 +538,11 @@ static int decode_ihdr_chunk(AVCodecContext *avctx, PNGDecContext *s, return AVERROR_INVALIDDATA; } +if (s->state & PNG_IHDR) { +av_log(avctx, AV_LOG_ERROR, "Multiple IHDR\n"); +return AVERROR_INVALIDDATA; +} + s->width = s->cur_w = bytestream2_get_be32(&s->gb); s->height = s->cur_h = bytestream2_get_be32(&s->gb); if (av_image_check_size(s->width, s->height, 0, avctx)) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/af_aresample: Check ff_all_* for allocation failures
ffmpeg | branch: release/2.5 | Michael Niedermayer | Fri Jul 17 20:27:25 2015 +0200| [384f6801a2ed1611e01df358ffbb08c689e38670] | committer: Michael Niedermayer avfilter/af_aresample: Check ff_all_* for allocation failures Fixes: signal_sigabrt_770eccc9_498_divx502.avi with memlimit 1572864 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 2ea8a480832acad3095783bcb11d5f290bec56cf) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=384f6801a2ed1611e01df358ffbb08c689e38670 --- libavfilter/af_aresample.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c index 57ac397..6cb765d 100644 --- a/libavfilter/af_aresample.c +++ b/libavfilter/af_aresample.c @@ -87,15 +87,24 @@ static int query_formats(AVFilterContext *ctx) AVFilterLink *inlink = ctx->inputs[0]; AVFilterLink *outlink = ctx->outputs[0]; -AVFilterFormats*in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); -AVFilterFormats*out_formats; -AVFilterFormats*in_samplerates = ff_all_samplerates(); -AVFilterFormats*out_samplerates; -AVFilterChannelLayouts *in_layouts = ff_all_channel_counts(); -AVFilterChannelLayouts *out_layouts; +AVFilterFormats*in_formats, *out_formats; +AVFilterFormats*in_samplerates, *out_samplerates; +AVFilterChannelLayouts *in_layouts, *out_layouts; + +in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); +if (!in_formats) +return AVERROR(ENOMEM); ff_formats_ref (in_formats, &inlink->out_formats); + +in_samplerates = ff_all_samplerates(); +if (!in_samplerates) +return AVERROR(ENOMEM); ff_formats_ref (in_samplerates, &inlink->out_samplerates); + +in_layouts = ff_all_channel_counts(); +if (!in_layouts) + return AVERROR(ENOMEM); ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts); if(out_rate > 0) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mov: Fix deallocation when MOVStreamContext failed to allocate
ffmpeg | branch: release/2.5 | Michael Niedermayer | Tue Jul 14 14:14:16 2015 +0200| [3953c497e2751bbbfd5063e4b7b54c868f46e031] | committer: Michael Niedermayer avformat/mov: Fix deallocation when MOVStreamContext failed to allocate Fixes: 260813283176b57b3c9974fe284eebc3_signal_sigsegv_7713351a_991_xtrem_e2_m64q15_a32sxx.3gp with memlimit of 262144 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 15629129dde771446a005282ee33c4ea1199e696) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3953c497e2751bbbfd5063e4b7b54c868f46e031 --- libavformat/mov.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index 783ad0d..137bc60 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3717,6 +3717,9 @@ static int mov_read_close(AVFormatContext *s) AVStream *st = s->streams[i]; MOVStreamContext *sc = st->priv_data; +if (!sc) +continue; + av_freep(&sc->ctts_data); for (j = 0; j < sc->drefs_count; j++) { av_freep(&sc->drefs[j].path); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/alac: Clear pointers in allocate_buffers()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jul 13 15:46:10 2015 +0200| [3489693051a7eaa43b219fc55286cb5e0c280902] | committer: Michael Niedermayer avcodec/alac: Clear pointers in allocate_buffers() Fixes: 06a4edb39ad8a9883175f9bd428334a2_signal_sigsegv_7713351a_706_mov__alac__ALAC_6ch.mov Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit f7068bf277a37479aecde2832208d820682b35e6) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3489693051a7eaa43b219fc55286cb5e0c280902 --- libavcodec/alac.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/alac.c b/libavcodec/alac.c index f5a5b86..48013f6 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -533,6 +533,12 @@ static int allocate_buffers(ALACContext *alac) int ch; int buf_size = alac->max_samples_per_frame * sizeof(int32_t); +for (ch = 0; ch < 2; ch++) { +alac->predict_error_buffer[ch] = NULL; +alac->output_samples_buffer[ch] = NULL; +alac->extra_bits_buffer[ch] = NULL; +} + for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) { FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch], buf_size, buf_alloc_fail); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: Fix crash with ost->last_frame allocation failure
ffmpeg | branch: release/2.5 | Michael Niedermayer | Tue Jul 14 13:02:19 2015 +0200| [40f5222e9c17b0ae759e38e2ba783017f183729b] | committer: Michael Niedermayer ffmpeg: Fix crash with ost->last_frame allocation failure Fixes: 1013dbde2c360d939cc2dfc33e4f275c_signal_sigsegv_a0500f_45_320vp3.nsv with memlimit of 536870912 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit fd4c87fa3becaf8a6c480db915daf51e297b76c5) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=40f5222e9c17b0ae759e38e2ba783017f183729b --- ffmpeg.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffmpeg.c b/ffmpeg.c index baaa101..43762ed 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1148,7 +1148,7 @@ static void do_video_out(AVFormatContext *s, if (!ost->last_frame) ost->last_frame = av_frame_alloc(); av_frame_unref(ost->last_frame); -if (next_picture) +if (next_picture && ost->last_frame) av_frame_ref(ost->last_frame, next_picture); else av_frame_free(&ost->last_frame); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/sanm: Reset sizes in destroy_buffers()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jul 13 16:05:21 2015 +0200| [1cb19f4f08d5681464fc19eb8d327775921de2c9] | committer: Michael Niedermayer avcodec/sanm: Reset sizes in destroy_buffers() Fixes crash in 1288a2fe8e9ae6b00ca40e089d08ca65_signal_sigsegv_771426a7_354_accident.san with allocation limit 65536 Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 39bbdebb1ed8eb9c9b0cd6db85afde6ba89d86e4) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1cb19f4f08d5681464fc19eb8d327775921de2c9 --- libavcodec/sanm.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 9e5ec54..2547abb 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -457,6 +457,7 @@ static void destroy_buffers(SANMVideoContext *ctx) ctx->frm0_size = ctx->frm1_size = ctx->frm2_size = 0; +init_sizes(ctx, 0, 0); } static av_cold int init_buffers(SANMVideoContext *ctx) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_transpose: Fix rounding error
ffmpeg | branch: release/2.5 | Michael Niedermayer | Tue Jun 30 16:01:15 2015 +0200| [c7cb598bdd8ac914ca300be7031cbe0208eb85e5] | committer: Michael Niedermayer avfilter/vf_transpose: Fix rounding error Fixes out of array access Fixes: asan_heap-oob_7f875d_3482_cov_1818465256_ssudec.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 0083c16605aa5997534e87e68f97ef85a8c3b7b8) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c7cb598bdd8ac914ca300be7031cbe0208eb85e5 --- libavfilter/vf_transpose.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c index d9b165c..6ae5fce 100644 --- a/libavfilter/vf_transpose.c +++ b/libavfilter/vf_transpose.c @@ -152,7 +152,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int hsub= plane == 1 || plane == 2 ? trans->hsub : 0; int vsub= plane == 1 || plane == 2 ? trans->vsub : 0; int pixstep = trans->pixsteps[plane]; -int inh = in->height >> vsub; +int inh = FF_CEIL_RSHIFT(in->height, vsub); int outw= FF_CEIL_RSHIFT(out->width, hsub); int outh= FF_CEIL_RSHIFT(out->height, vsub); int start = (outh * jobnr ) / nb_jobs; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mpegvideo: Clear pointers in ff_mpv_common_init()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Thu Jul 9 22:16:15 2015 +0200| [d137bb92b29895207d0d2fccb34c235451771671] | committer: Michael Niedermayer avcodec/mpegvideo: Clear pointers in ff_mpv_common_init() This ensures that no stale pointers leak through on any path Fixes: signal_sigsegv_c3097a_991_xtrem_e2_m64q15_a32sxx.3gp Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit b160fc290cf49b516c5b6ee0730fd9da7fc623b1) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d137bb92b29895207d0d2fccb34c235451771671 --- libavcodec/mpegvideo.c | 82 +--- 1 file changed, 78 insertions(+), 4 deletions(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index f84557b..ade85e9 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1286,6 +1286,82 @@ fail: return AVERROR(ENOMEM); } +static void clear_context(MpegEncContext *s) +{ +int i, j, k; + +memset(&s->next_picture, 0, sizeof(s->next_picture)); +memset(&s->last_picture, 0, sizeof(s->last_picture)); +memset(&s->current_picture, 0, sizeof(s->current_picture)); +memset(&s->new_picture, 0, sizeof(s->new_picture)); + +memset(s->thread_context, 0, sizeof(s->thread_context)); + +s->me.map = NULL; +s->me.score_map = NULL; +s->dct_error_sum = NULL; +s->block = NULL; +s->blocks = NULL; +memset(s->pblocks, 0, sizeof(s->pblocks)); +s->ac_val_base = NULL; +s->ac_val[0] = +s->ac_val[1] = +s->ac_val[2] =NULL; +s->edge_emu_buffer = NULL; +s->me.scratchpad = NULL; +s->me.temp = +s->rd_scratchpad = +s->b_scratchpad = +s->obmc_scratchpad = NULL; + +s->parse_context.buffer = NULL; +s->parse_context.buffer_size = 0; +s->bitstream_buffer = NULL; +s->allocated_bitstream_buffer_size = 0; +s->picture = NULL; +s->mb_type = NULL; +s->p_mv_table_base = NULL; +s->b_forw_mv_table_base = NULL; +s->b_back_mv_table_base = NULL; +s->b_bidir_forw_mv_table_base = NULL; +s->b_bidir_back_mv_table_base = NULL; +s->b_direct_mv_table_base = NULL; +s->p_mv_table= NULL; +s->b_forw_mv_table = NULL; +s->b_back_mv_table = NULL; +s->b_bidir_forw_mv_table = NULL; +s->b_bidir_back_mv_table = NULL; +s->b_direct_mv_table = NULL; +for (i = 0; i < 2; i++) { +for (j = 0; j < 2; j++) { +for (k = 0; k < 2; k++) { +s->b_field_mv_table_base[i][j][k] = NULL; +s->b_field_mv_table[i][j][k] = NULL; +} +s->b_field_select_table[i][j] = NULL; +s->p_field_mv_table_base[i][j] = NULL; +s->p_field_mv_table[i][j] = NULL; +} +s->p_field_select_table[i] = NULL; +} + +s->dc_val_base = NULL; +s->coded_block_base = NULL; +s->mbintra_table = NULL; +s->cbp_table = NULL; +s->pred_dir_table = NULL; + +s->mbskip_table = NULL; + +s->er.error_status_table = NULL; +s->er.er_temp_buffer = NULL; +s->mb_index2xy = NULL; +s->lambda_table = NULL; + +s->cplx_tab = NULL; +s->bits_tab = NULL; +} + /** * init common structure for both encoder and decoder. * this assumes that some variables like width/height are already set @@ -1297,6 +1373,8 @@ av_cold int ff_mpv_common_init(MpegEncContext *s) s->avctx->active_thread_type & FF_THREAD_SLICE) ? s->avctx->thread_count : 1; +clear_context(s); + if (s->encoding && s->avctx->slices) nb_slices = s->avctx->slices; @@ -1344,10 +1422,6 @@ av_cold int ff_mpv_common_init(MpegEncContext *s) if (!s->picture[i].f) goto fail; } -memset(&s->next_picture, 0, sizeof(s->next_picture)); -memset(&s->last_picture, 0, sizeof(s->last_picture)); -memset(&s->current_picture, 0, sizeof(s->current_picture)); -memset(&s->new_picture, 0, sizeof(s->new_picture)); s->next_picture.f = av_frame_alloc(); if (!s->next_picture.f) goto fail; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] bytestream2: set the reader to the end when reading more than available
ffmpeg | branch: release/2.5 | Anton Khirnov | Fri Jul 10 09:31:24 2015 +0200| [abe503329de0cdd988ba45e19aa72383fce23f8b] | committer: Michael Niedermayer bytestream2: set the reader to the end when reading more than available This prevents possible infinite loops with the calling code along the lines of while (bytestream2_get_bytes_left()) { ... }, where the reader does not advance. CC: libav-sta...@libav.org (cherry picked from commit 86eee85daddb682fa072c2e2657c90a514b855e3) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=abe503329de0cdd988ba45e19aa72383fce23f8b --- libavcodec/bytestream.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h index c2cb601..7c05ea6 100644 --- a/libavcodec/bytestream.h +++ b/libavcodec/bytestream.h @@ -71,8 +71,10 @@ static av_always_inline type bytestream2_get_ ## name ## u(GetByteContext *g) \ } \ static av_always_inline type bytestream2_get_ ## name(GetByteContext *g) \ { \ -if (g->buffer_end - g->buffer < bytes) \ +if (g->buffer_end - g->buffer < bytes) { \ +g->buffer = g->buffer_end; \ return 0; \ +} \ return bytestream2_get_ ## name ## u(g); \ } \ static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
ffmpeg | branch: release/2.5 | Michael Niedermayer | Fri Jul 10 02:01:17 2015 +0200| [80e091853d1e6ea2bcbc1972b87ce662f9eefff5] | committer: Michael Niedermayer avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264 Fixes Assertion failure Found-by: Andreas Cadhalpun Signed-off-by: Michael Niedermayer (cherry picked from commit 7ef6656b1e5bfbc7499013d3b38b093b6b2f31ec) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=80e091853d1e6ea2bcbc1972b87ce662f9eefff5 --- libavcodec/utils.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index d30ad2e..0cc1f90 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -424,10 +424,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, *width = FFALIGN(*width, w_align); *height = FFALIGN(*height, h_align); -if (s->codec_id == AV_CODEC_ID_H264 || s->lowres) +if (s->codec_id == AV_CODEC_ID_H264 || s->lowres) { // some of the optimized chroma MC reads one line too much // which is also done in mpeg decoders with lowres > 0 *height += 2; +*width = FFMAX(*width, 32); +} for (i = 0; i < 4; i++) linesize_align[i] = STRIDE_ALIGN; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] wmalosslessdec: reset frame->nb_samples on packet loss
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Fri Jul 3 00:02:44 2015 +0200| [dcfd83fb8e3c115cd294ae80304db10f7085efe9] | committer: Michael Niedermayer wmalosslessdec: reset frame->nb_samples on packet loss Otherwise a frame with non-zero nb_samples but without any data can be returned. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit 42e7a5b3c704985c2c18970cc94a837b413df9d9) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dcfd83fb8e3c115cd294ae80304db10f7085efe9 --- libavcodec/wmalosslessdec.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index ee4eb03..72535d5 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -1028,6 +1028,7 @@ static int decode_frame(WmallDecodeCtx *s) if ((ret = ff_get_buffer(s->avctx, s->frame, 0)) < 0) { /* return an error if no frame could be decoded at all */ s->packet_loss = 1; +s->frame->nb_samples = 0; return ret; } for (i = 0; i < s->num_channels; i++) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] oggparsedirac: check return value of init_get_bits
ffmpeg | branch: release/2.5 | Chris Watkins | Tue Jul 7 10:23:44 2015 -0700| [4f4ff23ccb88a6e815b9e8cbb95133491f1fb28c] | committer: Michael Niedermayer oggparsedirac: check return value of init_get_bits If init_get_bits fails the GetBitContext is invalid and must not be used. Check the return value in dirac_header and propogate the error. Signed-off-by: Michael Niedermayer (cherry picked from commit 4f5c2e651a95b950f6a3fb36f2342cbc32515f17) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f4ff23ccb88a6e815b9e8cbb95133491f1fb28c --- libavformat/oggparsedirac.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libavformat/oggparsedirac.c b/libavformat/oggparsedirac.c index 10fb07e..ab40f96 100644 --- a/libavformat/oggparsedirac.c +++ b/libavformat/oggparsedirac.c @@ -31,14 +31,19 @@ static int dirac_header(AVFormatContext *s, int idx) AVStream *st = s->streams[idx]; dirac_source_params source; GetBitContext gb; +int ret; // already parsed the header if (st->codec->codec_id == AV_CODEC_ID_DIRAC) return 0; -init_get_bits(&gb, os->buf + os->pstart + 13, (os->psize - 13) * 8); -if (avpriv_dirac_parse_sequence_header(st->codec, &gb, &source) < 0) -return -1; +ret = init_get_bits8(&gb, os->buf + os->pstart + 13, (os->psize - 13)); +if (ret < 0) +return ret; + +ret = avpriv_dirac_parse_sequence_header(st->codec, &gb, &source); +if (ret < 0) +return ret; st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = AV_CODEC_ID_DIRAC; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] wmavoice: limit wmavoice_decode_packet return value to packet size
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Sun Jun 28 12:40:12 2015 +0200| [755c3222e2c6b1f2da47361e5e10df528857f16a] | committer: Michael Niedermayer wmavoice: limit wmavoice_decode_packet return value to packet size Claiming to have decoded more bytes than the packet size is wrong. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit 2a4700a4f03280fa8ba4fc0f8a9987bb550f0d1e) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=755c3222e2c6b1f2da47361e5e10df528857f16a --- libavcodec/wmavoice.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index c2737ab..1c99588 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -1982,7 +1982,14 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data, *got_frame_ptr) { cnt += s->spillover_nbits; s->skip_bits_next = cnt & 7; -return cnt >> 3; +res = cnt >> 3; +if (res > avpkt->size) { +av_log(ctx, AV_LOG_ERROR, + "Trying to skip %d bytes in packet of size %d\n", + res, avpkt->size); +return AVERROR_INVALIDDATA; +} +return res; } else skip_bits_long (gb, s->spillover_nbits - cnt + get_bits_count(gb)); // resync @@ -2001,7 +2008,14 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, void *data, } else if (*got_frame_ptr) { int cnt = get_bits_count(gb); s->skip_bits_next = cnt & 7; -return cnt >> 3; +res = cnt >> 3; +if (res > avpkt->size) { +av_log(ctx, AV_LOG_ERROR, + "Trying to skip %d bytes in packet of size %d\n", + res, avpkt->size); +return AVERROR_INVALIDDATA; +} +return res; } else if ((s->sframe_cache_size = pos) > 0) { /* rewind bit reader to start of last (incomplete) superframe... */ init_get_bits(gb, avpkt->data, size << 3); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/aacsbr: Assert that bs_num_env is positive
ffmpeg | branch: release/2.5 | Michael Niedermayer | Wed Jul 1 02:08:25 2015 +0200| [dec0316c0f3bdf991ef4473566ebde1daaeefc86] | committer: Michael Niedermayer avcodec/aacsbr: Assert that bs_num_env is positive Signed-off-by: Michael Niedermayer (cherry picked from commit 2e13a45b1a9a69456631e582bbb06954d169eb55) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dec0316c0f3bdf991ef4473566ebde1daaeefc86 --- libavcodec/aacsbr.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c index eb00f88..1c06aba 100644 --- a/libavcodec/aacsbr.c +++ b/libavcodec/aacsbr.c @@ -1725,6 +1725,7 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac, sbr->c.sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1, (const float (*)[40][2]) sbr->X_low, sbr->k[0]); sbr_chirp(sbr, &sbr->data[ch]); +av_assert0(sbr->data[ch].bs_num_env > 0); sbr_hf_gen(ac, sbr, sbr->X_high, (const float (*)[40][2]) sbr->X_low, (const float (*)[2]) sbr->alpha0, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Sun Jul 5 20:00:15 2015 +0200| [e9deb5581075bfa79f22a6c228a23849f8199157] | committer: Michael Niedermayer avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2() the later is not optimal when the buffer size is well known at allocation time This avoids a memcpy() Overall 2.5% speedup with a random 1920x1080 video Signed-off-by: Michael Niedermayer (cherry picked from commit 47496eb97cff8130991313d1b7292613620d8592) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e9deb5581075bfa79f22a6c228a23849f8199157 --- libavcodec/rawenc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index c579230..9bcf5c4 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -51,7 +51,7 @@ static int raw_encode(AVCodecContext *avctx, AVPacket *pkt, if (ret < 0) return ret; -if ((ret = ff_alloc_packet2(avctx, pkt, ret)) < 0) +if ((ret = ff_alloc_packet(pkt, ret)) < 0) return ret; if ((ret = avpicture_layout((const AVPicture *)frame, avctx->pix_fmt, avctx->width, avctx->height, pkt->data, pkt->size)) < 0) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] wmalosslessdec: avoid reading 0 bits with get_bits
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Fri Jul 3 00:01:56 2015 +0200| [29a97823ba7c534d88ff414394a85f6d36ab6434] | committer: Michael Niedermayer wmalosslessdec: avoid reading 0 bits with get_bits Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit f9020d514e9ed5043496a710b36daba1ab182e97) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=29a97823ba7c534d88ff414394a85f6d36ab6434 --- libavcodec/wmalosslessdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index e6e3476..ee4eb03 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -486,7 +486,7 @@ static int decode_cdlms(WmallDecodeCtx *s) if ((1 << cbits) < s->cdlms[c][i].scaling + 1) cbits++; -s->cdlms[c][i].bitsend = get_bits(&s->gb, cbits) + 2; +s->cdlms[c][i].bitsend = (cbits ? get_bits(&s->gb, cbits) : 0) + 2; shift_l = 32 - s->cdlms[c][i].bitsend; shift_r = 32 - s->cdlms[c][i].scaling - 2; for (j = 0; j < s->cdlms[c][i].coefsend; j++) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h
ffmpeg | branch: release/2.5 | Michael Niedermayer | Tue Jun 30 19:37:12 2015 +0200| [58070590b1fc6a1d59326d7c87d03a2ee3a9a6b6] | committer: Michael Niedermayer avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h Fixes out of array access Fixes: asan_heap-oob_4d5bb0_682_cov_3124593265_Fraunhofer__a_driving_force_in_innovation__small.mp4 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 330863c9f19a23c500ba7901a23f1cc377b353bb) Conflicts: libavcodec/h264_slice.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58070590b1fc6a1d59326d7c87d03a2ee3a9a6b6 --- libavcodec/h264_slice.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 13b7482..425de8d 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1696,8 +1696,8 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0) (const uint8_t **)prev->f.data, prev->f.linesize, prev->f.format, - h->mb_width * 16, - h->mb_height * 16); + prev->f.width, + prev->f.height); h->short_ref[0]->poc = prev->poc + 2; } h->short_ref[0]->frame_num = h->prev_frame_num; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/aacsbr: check that the element type matches before applying SBR
ffmpeg | branch: release/2.5 | Michael Niedermayer | Wed Jul 1 02:05:43 2015 +0200| [1b15487e903b107559524bbf1f3663e04cc12cb5] | committer: Michael Niedermayer avcodec/aacsbr: check that the element type matches before applying SBR Fixes out of array access Fixes: signal_sigsegv_3670fc0_2818_cov_2307326154_moon.mux Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer (cherry picked from commit 79a98294da6cd85f8c86b34764c5e0c43b09eea3) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1b15487e903b107559524bbf1f3663e04cc12cb5 --- libavcodec/aacsbr.c |8 libavcodec/sbr.h|1 + 2 files changed, 9 insertions(+) diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c index 29ec2d5..eb00f88 100644 --- a/libavcodec/aacsbr.c +++ b/libavcodec/aacsbr.c @@ -1018,6 +1018,8 @@ static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr, { unsigned int cnt = get_bits_count(gb); +sbr->id_aac = id_aac; + if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) { if (read_sbr_single_channel_element(ac, sbr, gb)) { sbr_turnoff(sbr); @@ -1694,6 +1696,12 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac, int nch = (id_aac == TYPE_CPE) ? 2 : 1; int err; +if (id_aac != sbr->id_aac) { +av_log(ac->avctx, AV_LOG_ERROR, +"element type mismatch %d != %d\n", id_aac, sbr->id_aac); +sbr_turnoff(sbr); +} + if (!sbr->kx_and_m_pushed) { sbr->kx[0] = sbr->kx[1]; sbr->m[0] = sbr->m[1]; diff --git a/libavcodec/sbr.h b/libavcodec/sbr.h index e28fccd..ff00acb 100644 --- a/libavcodec/sbr.h +++ b/libavcodec/sbr.h @@ -137,6 +137,7 @@ typedef struct AACSBRContext { struct SpectralBandReplication { intsample_rate; intstart; +intid_aac; intreset; SpectrumParameters spectrum_params; intbs_amp_res_header; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vp9/update_prob: prevent out of bounds table read
ffmpeg | branch: release/2.5 | James Zern | Mon Jun 29 23:03:14 2015 -0700| [68650eda95228c9e94a1781166914ee35262d7d7] | committer: Michael Niedermayer vp9/update_prob: prevent out of bounds table read the max value of the lookup in expanded form is: (((1 << 7) - 1) << 1) - 65 + 1 + 64 = 254 add one entry of padding to inv_map_table[] to prevent out of bounds access with non-conforming / fuzzed bitstreams Signed-off-by: James Zern Reviewed-by: "Ronald S. Bultje" Signed-off-by: Michael Niedermayer (cherry picked from commit e91f860ea74e11e9178500fe8794c47f57dbf48c) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=68650eda95228c9e94a1781166914ee35262d7d7 --- libavcodec/vp9.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 8cf649e..b3c5f62 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -410,7 +410,7 @@ static av_always_inline int inv_recenter_nonneg(int v, int m) // differential forward probability updates static int update_prob(VP56RangeCoder *c, int p) { -static const int inv_map_table[254] = { +static const int inv_map_table[255] = { 7, 20, 33, 46, 59, 72, 85, 98, 111, 124, 137, 150, 163, 176, 189, 202, 215, 228, 241, 254, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, @@ -429,7 +429,7 @@ static int update_prob(VP56RangeCoder *c, int p) 207, 208, 209, 210, 211, 212, 213, 214, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, -252, 253, +252, 253, 253, }; int d; @@ -459,6 +459,7 @@ static int update_prob(VP56RangeCoder *c, int p) if (d >= 65) d = (d << 1) - 65 + vp8_rac_get(c); d += 64; +av_assert2(d < FF_ARRAY_ELEMS(inv_map_table)); } return p <= 128 ? 1 + inv_recenter_nonneg(inv_map_table[d], p - 1) : ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jun 29 13:51:43 2015 +0200| [bf44ab5181d42ee74768c32b07128a176d38b0c0] | committer: Michael Niedermayer swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian Fixes fate/dds-rgb16 on big endian Signed-off-by: Michael Niedermayer (cherry picked from commit f6ab967eae497733f6adc12b30075980fd6eea98) Conflicts: tests/ref/fate/dds-rgb16 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf44ab5181d42ee74768c32b07128a176d38b0c0 --- libswscale/swscale_unscaled.c |5 + 1 file changed, 5 insertions(+) diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index da457df..d3d0cf3 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -1242,6 +1242,11 @@ static rgbConvFn findRgbConvFn(SwsContext *c) if ((dstFormat == AV_PIX_FMT_RGB32_1 || dstFormat == AV_PIX_FMT_BGR32_1) && !isRGBA32(srcFormat) && ALT32_CORR<0) return NULL; +// Maintain symmetry between endianness +if (c->flags & SWS_BITEXACT) +if ((dstFormat == AV_PIX_FMT_RGB32 || dstFormat == AV_PIX_FMT_BGR32 ) && !isRGBA32(srcFormat) && ALT32_CORR>0) +return NULL; + return conv; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE
ffmpeg | branch: release/2.5 | Michael Niedermayer | Tue Jun 23 04:36:02 2015 +0200| [17b7262b4f9dca6a69dc35ac236c3407476cb21a] | committer: Michael Niedermayer swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE Signed-off-by: Michael Niedermayer (cherry picked from commit abb833c5681b84d7025c083e2191140eaa30dca7) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=17b7262b4f9dca6a69dc35ac236c3407476cb21a --- libswscale/rgb2rgb.c |2 +- libswscale/rgb2rgb.h |2 +- libswscale/rgb2rgb_template.c | 20 +++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c index 5b1fcf7..340174f 100644 --- a/libswscale/rgb2rgb.c +++ b/libswscale/rgb2rgb.c @@ -51,6 +51,7 @@ void (*rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size); void (*rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size); void (*rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size); +void (*shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size); void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size); void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, @@ -333,7 +334,6 @@ void shuffle_bytes_ ## a ## b ## c ## d(const uint8_t *src, \ } \ } -DEFINE_SHUFFLE_BYTES(0, 3, 2, 1) DEFINE_SHUFFLE_BYTES(1, 2, 3, 0) DEFINE_SHUFFLE_BYTES(3, 0, 1, 2) DEFINE_SHUFFLE_BYTES(3, 2, 1, 0) diff --git a/libswscale/rgb2rgb.h b/libswscale/rgb2rgb.h index 5df5dea..8faebe6 100644 --- a/libswscale/rgb2rgb.h +++ b/libswscale/rgb2rgb.h @@ -50,6 +50,7 @@ extern void(*rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size); extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size); extern void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size); void rgb64tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); @@ -71,7 +72,6 @@ void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size); void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size); voidrgb12to15(const uint8_t *src, uint8_t *dst, int src_size); -void shuffle_bytes_0321(const uint8_t *src, uint8_t *dst, int src_size); void shuffle_bytes_1230(const uint8_t *src, uint8_t *dst, int src_size); void shuffle_bytes_3012(const uint8_t *src, uint8_t *dst, int src_size); void shuffle_bytes_3210(const uint8_t *src, uint8_t *dst, int src_size); diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c index 70294ae..5b446de 100644 --- a/libswscale/rgb2rgb_template.c +++ b/libswscale/rgb2rgb_template.c @@ -328,6 +328,20 @@ static inline void shuffle_bytes_2103_c(const uint8_t *src, uint8_t *dst, } } +static inline void shuffle_bytes_0321_c(const uint8_t *src, uint8_t *dst, +int src_size) +{ +int idx = 15 - src_size; +const uint8_t *s = src - idx; +uint8_t *d = dst - idx; + +for (; idx < 15; idx += 4) { +register unsigned v = *(const uint32_t *)&s[idx], g = v & 0x00ff00ff; +v&= 0xff00ff00; +*(uint32_t *)&d[idx] = (v >> 16) + g + (v << 16); +} +} + static inline void rgb24tobgr24_c(const uint8_t *src, uint8_t *dst, int src_size) { unsigned i; @@ -929,7 +943,11 @@ static av_cold void rgb2rgb_init_c(void) rgb24to15 = rgb24to15_c; rgb24to16 = rgb24to16_c; rgb24tobgr24 = rgb24tobgr24_c; -#if !HAVE_BIGENDIAN +#if HAVE_BIGENDIAN +shuffle_bytes_0321 = shuffle_bytes_2103_c; +shuffle_bytes_2103 = shuffle_bytes_0321_c; +#else +shuffle_bytes_0321 = shuffle_bytes_0321_c; shuffle_bytes_2103 = shuffle_bytes_2103_c; #endif rgb32tobgr16 = rgb32tobgr16_c; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pngdec: Require a IHDR chunk before fctl
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jun 29 21:57:12 2015 +0200| [0628dfd99427037ddb535c6c0e248d192e678c7b] | committer: Michael Niedermayer avcodec/pngdec: Require a IHDR chunk before fctl This is required by the APNG spec Signed-off-by: Michael Niedermayer (cherry picked from commit a1736926e9ae51706b537776722e816a4d1f6b36) Conflicts: libavcodec/pngdec.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0628dfd99427037ddb535c6c0e248d192e678c7b --- libavcodec/pngdec.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 092528e..b60b2a0 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -813,6 +813,11 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s, if (length != 26) return AVERROR_INVALIDDATA; +if (!(s->state & PNG_IHDR)) { +av_log(avctx, AV_LOG_ERROR, "fctl before IHDR\n"); +return AVERROR_INVALIDDATA; +} + sequence_number = bytestream2_get_be32(&s->gb); s->cur_w= bytestream2_get_be32(&s->gb); s->cur_h= bytestream2_get_be32(&s->gb); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Tue Jun 23 05:09:11 2015 +0200| [7085f68c14ba1c46b5b315b718ec4068abac9c12] | committer: Michael Niedermayer swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c() Signed-off-by: Michael Niedermayer (cherry picked from commit 7604358018229f345dfdf88b16c8930a67984435) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7085f68c14ba1c46b5b315b718ec4068abac9c12 --- libswscale/rgb2rgb_template.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c index 5b446de..1cc28cd 100644 --- a/libswscale/rgb2rgb_template.c +++ b/libswscale/rgb2rgb_template.c @@ -322,7 +322,7 @@ static inline void shuffle_bytes_2103_c(const uint8_t *src, uint8_t *dst, uint8_t *d = dst - idx; for (; idx < 15; idx += 4) { -register int v= *(const uint32_t *)&s[idx], g = v & 0xff00ff00; +register unsigned v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00; v&= 0xff00ff; *(uint32_t *)&d[idx] = (v >> 16) + g + (v << 16); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/pngdec: Check values before updating context in decode_fctl_chunk( )
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jun 29 22:32:02 2015 +0200| [6a71e748b3a5d916c056b8dd5bb96671d8ee254e] | committer: Michael Niedermayer avcodec/pngdec: Check values before updating context in decode_fctl_chunk() Signed-off-by: Michael Niedermayer (cherry picked from commit b54ac8403bfea4e7fab0799ccfe728ba76959a38) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a71e748b3a5d916c056b8dd5bb96671d8ee254e --- libavcodec/pngdec.c | 34 +- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index b60b2a0..d5ad14e 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -809,6 +809,7 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s, uint32_t length) { uint32_t sequence_number; +int cur_w, cur_h, x_offset, y_offset, dispose_op, blend_op; if (length != 26) return AVERROR_INVALIDDATA; @@ -819,23 +820,23 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s, } sequence_number = bytestream2_get_be32(&s->gb); -s->cur_w= bytestream2_get_be32(&s->gb); -s->cur_h= bytestream2_get_be32(&s->gb); -s->x_offset = bytestream2_get_be32(&s->gb); -s->y_offset = bytestream2_get_be32(&s->gb); +cur_w = bytestream2_get_be32(&s->gb); +cur_h = bytestream2_get_be32(&s->gb); +x_offset= bytestream2_get_be32(&s->gb); +y_offset= bytestream2_get_be32(&s->gb); bytestream2_skip(&s->gb, 4); /* delay_num (2), delay_den (2) */ -s->dispose_op = bytestream2_get_byte(&s->gb); -s->blend_op = bytestream2_get_byte(&s->gb); +dispose_op = bytestream2_get_byte(&s->gb); +blend_op= bytestream2_get_byte(&s->gb); bytestream2_skip(&s->gb, 4); /* crc */ if (sequence_number == 0 && -(s->cur_w != s->width || - s->cur_h != s->height || - s->x_offset != 0 || - s->y_offset != 0) || -s->cur_w <= 0 || s->cur_h <= 0 || -s->x_offset < 0 || s->y_offset < 0 || -s->cur_w > s->width - s->x_offset|| s->cur_h > s->height - s->y_offset) +(cur_w != s->width || + cur_h != s->height || + x_offset != 0 || + y_offset != 0) || +cur_w <= 0 || cur_h <= 0 || +x_offset < 0 || y_offset < 0 || +cur_w > s->width - x_offset|| cur_h > s->height - y_offset) return AVERROR_INVALIDDATA; /* always (re)start with a clean frame */ @@ -849,6 +850,13 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s, s->dispose_op = APNG_DISPOSE_OP_NONE; } +s->cur_w = cur_w; +s->cur_h = cur_h; +s->x_offset = x_offset; +s->y_offset = y_offset; +s->dispose_op = dispose_op; +s->blend_op = blend_op; + return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx, mmxext}
ffmpeg | branch: release/2.5 | James Almer | Tue Jun 23 01:15:07 2015 -0300| [1fc2a1f3367c69a21da380a0cb76cf2a74ad0de1] | committer: Michael Niedermayer swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext} Reviewed-by: Michael Niedermayer Signed-off-by: James Almer (cherry picked from commit e22edbfd413242dda720dc5191fc00a51c24d74c) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1fc2a1f3367c69a21da380a0cb76cf2a74ad0de1 --- libswscale/x86/rgb2rgb_template.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/x86/rgb2rgb_template.c b/libswscale/x86/rgb2rgb_template.c index fd04923..e9b131e 100644 --- a/libswscale/x86/rgb2rgb_template.c +++ b/libswscale/x86/rgb2rgb_template.c @@ -1090,7 +1090,7 @@ static inline void RENAME(shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, : "r" (s), "r" (d), "m" (mask32b), "m" (mask32r), "m" (mmx_one) : "memory"); for (; idx<15; idx+=4) { -register int v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00; +register unsigned v = *(const uint32_t *)&s[idx], g = v & 0xff00ff00; v &= 0xff00ff; *(uint32_t *)&d[idx] = (v>>16) + g + (v<<16); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jun 22 22:23:22 2015 +0200| [f9dbe8ab2a03c8843c45536589b5d4fe9546ae8d] | committer: Michael Niedermayer swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian The function is specific to little endian Signed-off-by: Michael Niedermayer (cherry picked from commit 4df3cf90bf7a54793e90304bd1b6c7599673f36a) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f9dbe8ab2a03c8843c45536589b5d4fe9546ae8d --- libswscale/rgb2rgb_template.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c index f9a98a8..70294ae 100644 --- a/libswscale/rgb2rgb_template.c +++ b/libswscale/rgb2rgb_template.c @@ -929,7 +929,9 @@ static av_cold void rgb2rgb_init_c(void) rgb24to15 = rgb24to15_c; rgb24to16 = rgb24to16_c; rgb24tobgr24 = rgb24tobgr24_c; +#if !HAVE_BIGENDIAN shuffle_bytes_2103 = shuffle_bytes_2103_c; +#endif rgb32tobgr16 = rgb32tobgr16_c; rgb32tobgr15 = rgb32tobgr15_c; yv12toyuy2 = yv12toyuy2_c; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swscale/x86/rgb2rgb_template: add missing xmm clobbers
ffmpeg | branch: release/2.5 | James Almer | Tue Jun 23 01:14:16 2015 -0300| [3528822f969ebbec0b63316ba341e2749a94be4d] | committer: Michael Niedermayer swscale/x86/rgb2rgb_template: add missing xmm clobbers Reviewed-by: Michael Niedermayer Signed-off-by: James Almer (cherry picked from commit 910eeab48026060b5f7780b2560445c069eb4d6b) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3528822f969ebbec0b63316ba341e2749a94be4d --- libswscale/x86/rgb2rgb_template.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/x86/rgb2rgb_template.c b/libswscale/x86/rgb2rgb_template.c index e71c7eb..fd04923 100644 --- a/libswscale/x86/rgb2rgb_template.c +++ b/libswscale/x86/rgb2rgb_template.c @@ -1905,7 +1905,7 @@ static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, ui "cmp %3, %%"REG_a" \n\t" " jb 1b \n\t" ::"r"(dest), "r"(src1), "r"(src2), "r" ((x86_reg)width-15) -: "memory", "%"REG_a"" +: "memory", XMM_CLOBBERS("xmm0", "xmm1", "xmm2",) "%"REG_a ); #else __asm__( ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] matroskadec: check audio sample rate
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Mon Jun 15 20:59:22 2015 +0200| [a5bc5dd49ae1ed29489f9c8ba88387322c376bf1] | committer: Michael Niedermayer matroskadec: check audio sample rate And default to 8000 if it is invalid. An invalid sample rate can trigger av_assert2 in av_rescale_rnd. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit 5b76c82fd7a5f4f36bb901b8c43d7f7319599599) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5bc5dd49ae1ed29489f9c8ba88387322c376bf1 --- libavformat/matroskadec.c |8 1 file changed, 8 insertions(+) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 0654b31..120a554 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1604,6 +1604,14 @@ static int matroska_parse_tracks(AVFormatContext *s) if (!track->codec_id) continue; +if (track->audio.samplerate < 0 || track->audio.samplerate > INT_MAX || +isnan(track->audio.samplerate)) { +av_log(matroska->ctx, AV_LOG_WARNING, + "Invalid sample rate %f, defaulting to 8000 instead.\n", + track->audio.samplerate); +track->audio.samplerate = 8000; +} + if (track->type == MATROSKA_TRACK_TYPE_VIDEO) { if (!track->default_duration && track->video.frame_rate > 0) track->default_duration = 10 / track->video.frame_rate; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vda: unlock the pixel buffer base address.
ffmpeg | branch: release/2.5 | Sebastien Zwickert | Sat Jun 20 13:19:29 2015 +0200| [8f067955332dc185003f30387c5deb41fe954786] | committer: Michael Niedermayer vda: unlock the pixel buffer base address. The pixel buffer base address is never unlocked this causes a bug with some pixel format types that are produced natively by the hardware decoder: the first buffer was always used. Unlock the pixel buffer base address fixes the issue. (cherry picked from commit c06fdacc3dc706e70d953917fea845532d3703ca) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8f067955332dc185003f30387c5deb41fe954786 --- ffmpeg_vda.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/ffmpeg_vda.c b/ffmpeg_vda.c index b9f0975..fded39e 100644 --- a/ffmpeg_vda.c +++ b/ffmpeg_vda.c @@ -77,6 +77,8 @@ static int vda_retrieve_data(AVCodecContext *s, AVFrame *frame) frame->width, frame->height); ret = av_frame_copy_props(vda->tmp_frame, frame); +CVPixelBufferUnlockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly); + if (ret < 0) return ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swr: Remember previously set int_sample_format from user
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon Jun 22 18:27:27 2015 +0200| [7ff8f9a604f09e208c6d017c4ab88dd8c0ba6430] | committer: Michael Niedermayer swr: Remember previously set int_sample_format from user Signed-off-by: Michael Niedermayer (cherry picked from commit d4325b2fea9e2f4f4a17d0b929f12425e9c39964) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ff8f9a604f09e208c6d017c4ab88dd8c0ba6430 --- libswresample/options.c |4 ++-- libswresample/swresample.c |2 ++ libswresample/swresample_internal.h |1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libswresample/options.c b/libswresample/options.c index de84672..1bc1a70 100644 --- a/libswresample/options.c +++ b/libswresample/options.c @@ -49,8 +49,8 @@ static const AVOption options[]={ {"in_sample_fmt", "set input sample format" , OFFSET( in_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM}, {"osf" , "set output sample format", OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM}, {"out_sample_fmt" , "set output sample format", OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM}, -{"tsf" , "set internal sample format" , OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM}, -{"internal_sample_fmt" , "set internal sample format" , OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM}, +{"tsf" , "set internal sample format" , OFFSET(user_int_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM}, +{"internal_sample_fmt" , "set internal sample format" , OFFSET(user_int_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1 , INT_MAX, PARAM}, {"icl" , "set input channel layout", OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0 }, 0 , INT64_MAX , PARAM, "channel_layout"}, {"in_channel_layout", "set input channel layout", OFFSET(user_in_ch_layout ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0 }, 0 , INT64_MAX , PARAM, "channel_layout"}, {"ocl" , "set output channel layout" , OFFSET(user_out_ch_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0 }, 0 , INT64_MAX , PARAM, "channel_layout"}, diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 6dde73b..dbcb42e 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -173,6 +173,8 @@ av_cold int swr_init(struct SwrContext *s){ s-> in_ch_layout = s-> user_in_ch_layout; s->out_ch_layout = s->user_out_ch_layout; +s->int_sample_fmt= s->user_int_sample_fmt; + if(av_get_channel_layout_nb_channels(s-> in_ch_layout) > SWR_CH_MAX) { av_log(s, AV_LOG_WARNING, "Input channel layout 0x%"PRIx64" is invalid or unsupported.\n", s-> in_ch_layout); s->in_ch_layout = 0; diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h index fcc63a6..f55bd9d 100644 --- a/libswresample/swresample_internal.h +++ b/libswresample/swresample_internal.h @@ -95,6 +95,7 @@ struct SwrContext { int user_used_ch_count; ///< User set used channel count int64_t user_in_ch_layout; ///< User set input channel layout int64_t user_out_ch_layout; ///< User set output channel layout +enum AVSampleFormat user_int_sample_fmt;///< User set internal sample format struct DitherContext dither; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/dpxenc: implement write16/32 as functions
ffmpeg | branch: release/2.5 | Michael Niedermayer | Fri Jun 19 16:46:06 2015 +0200| [fc0df14de1a6f75be52b77e067608d833a68c05c] | committer: Michael Niedermayer avcodec/dpxenc: implement write16/32 as functions Fixes undefined behavior and segfault Signed-off-by: Michael Niedermayer (cherry picked from commit 8edc17b639c4ac47913c467107ffb43c67c64890) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc0df14de1a6f75be52b77e067608d833a68c05c --- libavcodec/dpxenc.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c index aca745b..76aa0cc 100644 --- a/libavcodec/dpxenc.c +++ b/libavcodec/dpxenc.c @@ -75,17 +75,20 @@ static av_cold int encode_init(AVCodecContext *avctx) return 0; } -#define write16(p, value) \ -do { \ -if (s->big_endian) AV_WB16(p, value); \ -else AV_WL16(p, value); \ -} while(0) +static av_always_inline void write16_internal(int big_endian, void *p, int value) +{ +if (big_endian) AV_WB16(p, value); +elseAV_WL16(p, value); +} + +static av_always_inline void write32_internal(int big_endian, void *p, int value) +{ +if (big_endian) AV_WB32(p, value); +elseAV_WL32(p, value); +} -#define write32(p, value) \ -do { \ -if (s->big_endian) AV_WB32(p, value); \ -else AV_WL32(p, value); \ -} while(0) +#define write16(p, value) write16_internal(s->big_endian, p, value) +#define write32(p, value) write32_internal(s->big_endian, p, value) static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] matroskadec: validate audio channels and bitdepth
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Mon Jun 15 21:06:51 2015 +0200| [5464da89056698856d919585256bb422558eb554] | committer: Michael Niedermayer matroskadec: validate audio channels and bitdepth In the TTA extradata re-construction the values are written with avio_wl16 and if they don't fit into uint16_t, this triggers an av_assert2 in avio_w8. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit 92e79a2f7bf2f8bb0cb2d1a3e4d76737557071c4) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5464da89056698856d919585256bb422558eb554 --- libavformat/matroskadec.c | 12 1 file changed, 12 insertions(+) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 0bfa9dc..0654b31 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1799,6 +1799,18 @@ static int matroska_parse_tracks(AVFormatContext *s) NULL, NULL, NULL, NULL); avio_write(&b, "TTA1", 4); avio_wl16(&b, 1); +if (track->audio.channels > UINT16_MAX || +track->audio.bitdepth > UINT16_MAX) { +av_log(matroska->ctx, AV_LOG_WARNING, + "Too large audio channel number %"PRIu64 + " or bitdepth %"PRIu64". Skipping track.\n", + track->audio.channels, track->audio.bitdepth); +av_freep(&extradata); +if (matroska->ctx->error_recognition & AV_EF_EXPLODE) +return AVERROR_INVALIDDATA; +else +continue; +} avio_wl16(&b, track->audio.channels); avio_wl16(&b, track->audio.bitdepth); if (track->audio.out_samplerate < 0 || track->audio.out_samplerate > INT_MAX) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] postproc: fix unaligned access
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Thu Jun 18 20:15:12 2015 +0200| [dd141a50ccb3913d6e9b46478cac7a640e76ddc4] | committer: Michael Niedermayer postproc: fix unaligned access QP_store is only 8-bit-aligned, so accessing it as uint32_t causes SIGBUS crashes on sparc. The AV_RN32/AV_WN32 macros only do unaligned access in the HAVE_FAST_UNALIGNED case. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit 590743101dc934043f34013f1c9bb9fb261355b0) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd141a50ccb3913d6e9b46478cac7a640e76ddc4 --- libpostproc/postprocess.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index c11debc..1b90a51 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -76,6 +76,7 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks #include "config.h" #include "libavutil/avutil.h" #include "libavutil/avassert.h" +#include "libavutil/intreadwrite.h" #include #include #include @@ -1024,7 +1025,7 @@ void pp_postprocess(const uint8_t * src[3], const int srcStride[3], int i; const int count= FFMAX(mbHeight * QPStride, mbWidth); for(i=0; i<(count>>2); i++){ -((uint32_t*)c->nonBQPTable)[i] = ((const uint32_t*)QP_store)[i] & 0x3F3F3F3F; +AV_WN32(c->nonBQPTable + (i<<2), AV_RN32(QP_store + (i<<2)) & 0x3F3F3F3F); } for(i<<=2; inonBQPTable[i] = QP_store[i] & 0x3F; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avio: fix potential crashes when combining ffio_ensure_seekback + crc
ffmpeg | branch: release/2.5 | wm4 | Wed Jun 17 00:21:02 2015 +0200| [3903a60d4beeb46cda5d830be2eb2bac76171ce8] | committer: Michael Niedermayer avio: fix potential crashes when combining ffio_ensure_seekback + crc Calling ffio_ensure_seekback() if ffio_init_checksum() has been called on the same context can lead to out of bounds memory accesses and crashes. The reason is that ffio_ensure_seekback() does not update checksum_ptr after reallocating the buffer, resulting in a dangling pointer. This effectively fixes potential crashes when opening mp3 files. Signed-off-by: Michael Niedermayer (cherry picked from commit dc87758775e2ce8be84e4fe598e12416e83d2845) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3903a60d4beeb46cda5d830be2eb2bac76171ce8 --- libavformat/aviobuf.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 0b0748e..4ce18e4 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -785,6 +785,7 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size) int max_buffer_size = s->max_packet_size ? s->max_packet_size : IO_BUFFER_SIZE; int filled = s->buf_end - s->buffer; +ptrdiff_t checksum_ptr_offset = s->checksum_ptr ? s->checksum_ptr - s->buffer : -1; buf_size += s->buf_ptr - s->buffer + max_buffer_size; @@ -802,6 +803,8 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size) s->buf_end = buffer + (s->buf_end - s->buffer); s->buffer = buffer; s->buffer_size = buf_size; +if (checksum_ptr_offset >= 0) +s->checksum_ptr = s->buffer + checksum_ptr_offset; return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vp8: change mv_{min,max}.{x,y} type to int
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Mon Jun 8 22:38:29 2015 +0200| [27d50fb2d52bc1fb85d13b968f61a70ea8defc9e] | committer: Michael Niedermayer vp8: change mv_{min,max}.{x,y} type to int If one of the dimensions is larger than 8176, s->mb_width or s->mb_height is larger than 511, leading to an int16_t overflow of s->mv_max.{x,y}. This then causes av_clip to be called with amin > amax. Changing the type to int avoids the overflow and has no negative effect, because s->mv_max is only used in clamp_mv for clipping. Since mv_max.{x,y} is positive and mv_min.{x,y} negative, av_clip can't increase the absolute value. The input to av_clip is an int16_t, and thus the output fits into int16_t as well. For additional safety, s->mv_{min,max}.{x,y} are clipped to int16_t range before use. Reviewed-by: Ronald S. Bultje Signed-off-by: Andreas Cadhalpun (cherry picked from commit 6fdbaa2b7fb56623ab2163f861952bc1408c39b3) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=27d50fb2d52bc1fb85d13b968f61a70ea8defc9e --- libavcodec/vp8.c |6 -- libavcodec/vp8.h |9 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 5d3123d..86eb4e9 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -757,8 +757,10 @@ static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si static av_always_inline void clamp_mv(VP8Context *s, VP56mv *dst, const VP56mv *src) { -dst->x = av_clip(src->x, s->mv_min.x, s->mv_max.x); -dst->y = av_clip(src->y, s->mv_min.y, s->mv_max.y); +dst->x = av_clip(src->x, av_clip(s->mv_min.x, INT16_MIN, INT16_MAX), + av_clip(s->mv_max.x, INT16_MIN, INT16_MAX)); +dst->y = av_clip(src->y, av_clip(s->mv_min.y, INT16_MIN, INT16_MAX), + av_clip(s->mv_max.y, INT16_MIN, INT16_MAX)); } /** diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h index b650892..2135bd9 100644 --- a/libavcodec/vp8.h +++ b/libavcodec/vp8.h @@ -134,6 +134,11 @@ typedef struct VP8Frame { AVBufferRef *seg_map; } VP8Frame; +typedef struct VP8intmv { +int x; +int y; +} VP8intmv; + #define MAX_THREADS 8 typedef struct VP8Context { VP8ThreadData *thread_data; @@ -152,8 +157,8 @@ typedef struct VP8Context { uint8_t deblock_filter; uint8_t mbskip_enabled; uint8_t profile; -VP56mv mv_min; -VP56mv mv_max; +VP8intmv mv_min; +VP8intmv mv_max; int8_t sign_bias[4]; ///< one state [0, 1] per ref frame type int ref_count[3]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg_opt: Check for localtime() failure
ffmpeg | branch: release/2.5 | Michael Niedermayer | Fri Jun 12 15:36:20 2015 +0200| [7d03a9156da3df077feb4a5235d9393d313cd5ff] | committer: Michael Niedermayer ffmpeg_opt: Check for localtime() failure Found-by: Daemon404 Signed-off-by: Michael Niedermayer (cherry picked from commit 8e91d9652ea5048d9014e7636e12c6ed4732d7b7) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d03a9156da3df077feb4a5235d9393d313cd5ff --- ffmpeg_opt.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index ea16a11..e0c48ce 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -2345,6 +2345,9 @@ static int opt_vstats(void *optctx, const char *opt, const char *arg) time_t today2 = time(NULL); struct tm *today = localtime(&today2); +if (!today) +return AVERROR(errno); + snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, today->tm_sec); return opt_vstats_file(NULL, opt, filename); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] arm: only enable setend on ARMv6
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Thu Jun 4 23:07:44 2015 +0200| [b4d265e2dcd9f714df83c5b7468e28dc1e274397] | committer: Michael Niedermayer arm: only enable setend on ARMv6 Without this check it causes SIGILL crashes on ARMv5. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit 5bf84a584e9ce681b439a5747671e2809a019c83) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b4d265e2dcd9f714df83c5b7468e28dc1e274397 --- libavutil/arm/cpu.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c index f1683e8..02def0b 100644 --- a/libavutil/arm/cpu.c +++ b/libavutil/arm/cpu.c @@ -128,7 +128,7 @@ int ff_get_cpu_flags_arm(void) trickle down. */ if (flags & (AV_CPU_FLAG_VFPV3 | AV_CPU_FLAG_NEON)) flags |= AV_CPU_FLAG_ARMV6T2; -else +else if (flags & (AV_CPU_FLAG_ARMV6T2 | AV_CPU_FLAG_ARMV6)) /* Some functions use the 'setend' instruction which is deprecated on ARMv8 * and serializing on some ARMv7 cores. This ensures such functions * are only enabled on ARMv6. */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] sonic: set avctx->channels in sonic_decode_init
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Tue Jun 9 22:41:24 2015 +0200| [da13957525a7939599cf7f425c2feb00ea5a] | committer: Michael Niedermayer sonic: set avctx->channels in sonic_decode_init Otherwise it can be 0 in sonic_decode_frame, causing SIGFPE crashes. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit 58995f647b5fa2e1efa33ae4f8b8a76a81ec99df) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da13957525a7939599cf7f425c2feb00ea5a --- libavcodec/sonic.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index 3db77f3..c5076f9 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -900,6 +900,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "Only mono and stereo streams are supported by now\n"); return AVERROR_INVALIDDATA; } +avctx->channels = s->channels; s->lossless = get_bits1(&gb); if (!s->lossless) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: Free last_frame instead of just unref
ffmpeg | branch: release/2.5 | Michael Niedermayer | Thu Jun 18 05:27:08 2015 +0200| [568c1b8166b111d41e6b416e6d98244072fb087a] | committer: Michael Niedermayer ffmpeg: Free last_frame instead of just unref Fixes Ticket4611 Signed-off-by: Michael Niedermayer (cherry picked from commit d1050d9950610aa2b27878b67bb2b902dd717e7c) Conflicts: ffmpeg.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=568c1b8166b111d41e6b416e6d98244072fb087a --- ffmpeg.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ffmpeg.c b/ffmpeg.c index 6e640e3..60d8e89 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1142,7 +1142,10 @@ static void do_video_out(AVFormatContext *s, if (!ost->last_frame) ost->last_frame = av_frame_alloc(); av_frame_unref(ost->last_frame); -av_frame_ref(ost->last_frame, next_picture); +if (next_picture) +av_frame_ref(ost->last_frame, next_picture); +else +av_frame_free(&ost->last_frame); } static double psnr(double d) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mov: abort on EOF in ff_mov_read_chan
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Sat May 23 23:32:12 2015 +0200| [7a12379463b5d9cf31424d339f4b02cfd7d9e22f] | committer: Michael Niedermayer mov: abort on EOF in ff_mov_read_chan Otherwise the loop can take a lot of time if num_descr is very large. Signed-off-by: Andreas Cadhalpun (cherry picked from commit a5718863da99b54b6c853d45c84871c4a96a57c0) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a12379463b5d9cf31424d339f4b02cfd7d9e22f --- libavformat/mov_chan.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c index 3b91ed7..b63310b 100644 --- a/libavformat/mov_chan.c +++ b/libavformat/mov_chan.c @@ -566,6 +566,11 @@ int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st, label_mask = 0; for (i = 0; i < num_descr; i++) { uint32_t label; +if (pb->eof_reached) { +av_log(s, AV_LOG_ERROR, + "reached EOF while reading channel layout\n"); +return AVERROR_INVALIDDATA; +} label = avio_rb32(pb); // mChannelLabel avio_rb32(pb); // mChannelFlags avio_rl32(pb); // mCoordinates[0] ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swresample/swresample: Cleanup on init failure.
ffmpeg | branch: release/2.5 | Michael Niedermayer | Thu Jun 4 03:47:55 2015 +0200| [de943a3460a8a0f88cbdbfa1ef16ae93dbbbee29] | committer: Michael Niedermayer swresample/swresample: Cleanup on init failure. This avoids leaks if the user doest call swr_close() after a failed init Found-by: James Almer Reviewed-by: James Almer Signed-off-by: Michael Niedermayer (cherry picked from commit c3f87f7545d42520921bc448b9fbd7324c574e49) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de943a3460a8a0f88cbdbfa1ef16ae93dbbbee29 --- libswresample/swresample.c | 34 -- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 2cd9d45..6dde73b 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -267,7 +267,8 @@ av_cold int swr_init(struct SwrContext *s){ && s->int_sample_fmt != AV_SAMPLE_FMT_DBLP && s->resample){ av_log(s, AV_LOG_ERROR, "Resampling only supported with internal s16/s32/flt/dbl\n"); -return -1; +ret = AVERROR(EINVAL); +goto fail; } #define RSC 1 //FIXME finetune @@ -281,24 +282,28 @@ av_cold int swr_init(struct SwrContext *s){ if(!s-> in.ch_count){ av_assert0(!s->in_ch_layout); av_log(s, AV_LOG_ERROR, "Input channel count and layout are unset\n"); -return -1; +ret = AVERROR(EINVAL); +goto fail; } av_get_channel_layout_string(l1, sizeof(l1), s-> in.ch_count, s-> in_ch_layout); av_get_channel_layout_string(l2, sizeof(l2), s->out.ch_count, s->out_ch_layout); if (s->out_ch_layout && s->out.ch_count != av_get_channel_layout_nb_channels(s->out_ch_layout)) { av_log(s, AV_LOG_ERROR, "Output channel layout %s mismatches specified channel count %d\n", l2, s->out.ch_count); -return AVERROR(EINVAL); +ret = AVERROR(EINVAL); +goto fail; } if (s->in_ch_layout && s->used_ch_count != av_get_channel_layout_nb_channels(s->in_ch_layout)) { av_log(s, AV_LOG_ERROR, "Input channel layout %s mismatches specified channel count %d\n", l1, s->used_ch_count); -return AVERROR(EINVAL); +ret = AVERROR(EINVAL); +goto fail; } if ((!s->out_ch_layout || !s->in_ch_layout) && s->used_ch_count != s->out.ch_count && !s->rematrix_custom) { av_log(s, AV_LOG_ERROR, "Rematrix is needed between %s and %s " "but there is not enough information to do it\n", l1, l2); -return -1; +ret = AVERROR(EINVAL); +goto fail; } av_assert0(s->used_ch_count); @@ -320,8 +325,10 @@ av_assert0(s->out.ch_count); s->out_convert= swri_audio_convert_alloc(s->out_sample_fmt, s->int_sample_fmt, s->out.ch_count, NULL, 0); -if (!s->in_convert || !s->out_convert) -return AVERROR(ENOMEM); +if (!s->in_convert || !s->out_convert) { +ret = AVERROR(ENOMEM); +goto fail; +} s->postin= s->in; s->preout= s->out; @@ -348,12 +355,19 @@ av_assert0(s->out.ch_count); } if ((ret = swri_dither_init(s, s->out_sample_fmt, s->int_sample_fmt)) < 0) -return ret; +goto fail; -if(s->rematrix || s->dither.method) -return swri_rematrix_init(s); +if(s->rematrix || s->dither.method) { +ret = swri_rematrix_init(s); +if (ret < 0) +goto fail; +} return 0; +fail: +swr_close(s); +return ret; + } int swri_realloc_audio(AudioData *a, int count){ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] takdec: ensure chan2 is a valid channel index
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Wed Jun 10 00:12:38 2015 +0200| [3c99f8b4ada2076d40e01a14f125f69e3fcbe10a] | committer: Michael Niedermayer takdec: ensure chan2 is a valid channel index If chan2 is not smaller than the number of channels, it can cause segmentation faults due to dereferencing a NULL pointer. Signed-off-by: Andreas Cadhalpun Reviewed-by: Paul B Mahol Signed-off-by: Michael Niedermayer (cherry picked from commit 05c57ba2f42324da2fdc93d83d65bb68dd637613) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c99f8b4ada2076d40e01a14f125f69e3fcbe10a --- libavcodec/takdec.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 5810a01..6143858 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -799,6 +799,12 @@ static int tak_decode_frame(AVCodecContext *avctx, void *data, if (s->mcdparams[i].present) { s->mcdparams[i].index = get_bits(gb, 2); s->mcdparams[i].chan2 = get_bits(gb, 4); +if (s->mcdparams[i].chan2 >= avctx->channels) { +av_log(avctx, AV_LOG_ERROR, + "invalid channel 2 (%d) for %d channel(s)\n", + s->mcdparams[i].chan2, avctx->channels); +return AVERROR_INVALIDDATA; +} if (s->mcdparams[i].index == 1) { if ((nbit == s->mcdparams[i].chan2) || (ch_mask & 1 << s->mcdparams[i].chan2)) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vp9: change type of tile_size from unsigned to int64_t
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Sun Jun 7 18:50:43 2015 +0200| [e4e3b14bba127bdce9521a78446b294f6bc8e43b] | committer: Michael Niedermayer vp9: change type of tile_size from unsigned to int64_t Otherwise the check 'tile_size < size' treats a negative size as unsigned, causing the check to pass. This subsequently leads to segmentation faults. This was originally fixed as part of Libav commit 72ca83, so the original author is one of the following developers: Anton Khirnov Diego Biurrun Luca Barbato Martin Storsjö Reviewed-by: Ronald S. Bultje Signed-off-by: Andreas Cadhalpun (cherry picked from commit b18eac7ff22332c9344769af15f7b245dd13cc64) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e4e3b14bba127bdce9521a78446b294f6bc8e43b --- libavcodec/vp9.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index a051284..8cf649e 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -3856,7 +3856,7 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame, tile_row, s->tiling.log2_tile_rows, s->sb_rows); if (s->pass != 2) { for (tile_col = 0; tile_col < s->tiling.tile_cols; tile_col++) { -unsigned tile_size; +int64_t tile_size; if (tile_col == s->tiling.tile_cols - 1 && tile_row == s->tiling.tile_rows - 1) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/h264_slice: Use AVFrame diemensions for grayscale handling
ffmpeg | branch: release/2.5 | Michael Niedermayer | Wed Jun 10 11:37:48 2015 +0200| [f5a73058b0f26133bb366f8644711563db76fb74] | committer: Michael Niedermayer avcodec/h264_slice: Use AVFrame diemensions for grayscale handling The AVFrame values are closer to the AVFrame bitmap changed instead of the AVCodecContext values, so this should be more robust Signed-off-by: Michael Niedermayer (cherry picked from commit aef0e0f009802f1a5e21eb6465498632071e4475) Conflicts: libavcodec/h264_slice.c > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f5a73058b0f26133bb366f8644711563db76fb74 --- libavcodec/h264_slice.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 6b1db1a..d439f9b 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -278,11 +278,11 @@ static int alloc_picture(H264Context *h, H264Picture *pic) av_pix_fmt_get_chroma_sub_sample(pic->f.format, &h_chroma_shift, &v_chroma_shift); -for(i=0; iavctx->height, v_chroma_shift); i++) { +for(i=0; if.height, v_chroma_shift); i++) { memset(pic->f.data[1] + pic->f.linesize[1]*i, - 0x80, FF_CEIL_RSHIFT(h->avctx->width, h_chroma_shift)); + 0x80, FF_CEIL_RSHIFT(pic->f.width, h_chroma_shift)); memset(pic->f.data[2] + pic->f.linesize[2]*i, - 0x80, FF_CEIL_RSHIFT(h->avctx->width, h_chroma_shift)); + 0x80, FF_CEIL_RSHIFT(pic->f.width, h_chroma_shift)); } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Wed Jun 10 00:47:43 2015 +0200| [a2a545d8db8e9081dfae02e8f2ccfac8796783f1] | committer: Michael Niedermayer avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet() Signed-off-by: Michael Niedermayer (cherry picked from commit 913685f55208efd78bfc34d82b261bd449e69774) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a2a545d8db8e9081dfae02e8f2ccfac8796783f1 --- libavdevice/lavfi.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 1398ece..f6c92bc 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -339,7 +339,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt) continue; } else if (ret < 0) return ret; -d = av_rescale_q(frame->pts, tb, AV_TIME_BASE_Q); +d = av_rescale_q_rnd(frame->pts, tb, AV_TIME_BASE_Q, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); av_dlog(avctx, "sink_idx:%d time:%f\n", i, d); av_frame_unref(frame); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libopenjpegdec: check existence of image component data
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Sat May 30 16:18:48 2015 +0200| [a1879d347e6268635e19fcf4fd31cc4dfa0e161c] | committer: Michael Niedermayer libopenjpegdec: check existence of image component data libopenjpeg can return images with components without data. This fixes segmentation faults. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit 3ef5702926c495232ffe685303ba8661bdff1149) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1879d347e6268635e19fcf4fd31cc4dfa0e161c --- libavcodec/libopenjpegdec.c |9 + 1 file changed, 9 insertions(+) diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 0cf46e6..33c570f 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -356,6 +356,15 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, goto done; } +for (i = 0; i < image->numcomps; i++) { +if (!image->comps[i].data) { +av_log(avctx, AV_LOG_ERROR, + "Image component %d contains no data.\n", i); +ret = AVERROR_INVALIDDATA; +goto done; +} +} + desc = av_pix_fmt_desc_get(avctx->pix_fmt); pixel_size = desc->comp[0].step_minus1 + 1; ispacked = libopenjpeg_ispacked(avctx->pix_fmt); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] h264: er: Copy from the previous reference only if compatible
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Sun Jun 14 12:40:18 2015 +0200| [58a0dc1bdf67d11fbb2a46a1726ba9abc2550a9f] | committer: Michael Niedermayer h264: er: Copy from the previous reference only if compatible Also use the frame pixel format instead of the one from the codec context, which is more robust. Signed-off-by: Luca Barbato Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit fdc64a104410f5fcc7f35b62287b0ae502b7061a) Conflicts: libavcodec/h264_slice.c Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58a0dc1bdf67d11fbb2a46a1726ba9abc2550a9f --- libavcodec/h264_slice.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index d439f9b..13b7482 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1687,12 +1687,15 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0) * vectors. Given we are concealing a lost frame, this probably * is not noticeable by comparison, but it should be fixed. */ if (h->short_ref_count) { -if (prev) { +if (prev && +h->short_ref[0]->f.width == prev->f.width && +h->short_ref[0]->f.height == prev->f.height && +h->short_ref[0]->f.format == prev->f.format) { av_image_copy(h->short_ref[0]->f.data, h->short_ref[0]->f.linesize, (const uint8_t **)prev->f.data, prev->f.linesize, - h->avctx->pix_fmt, + prev->f.format, h->mb_width * 16, h->mb_height * 16); h->short_ref[0]->poc = prev->poc + 2; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat: Fix bug in parse_rps for HEVC.
ffmpeg | branch: release/2.5 | Deliang Fu | Wed Jun 10 12:30:46 2015 +0800| [bda906a19561f6e4cc60c9dd494eef1669a438b9] | committer: Michael Niedermayer avformat: Fix bug in parse_rps for HEVC. Make the logic in libavformat/hevc.c parse_rps align with libavcodec/hevc_ps.c ff_hevc_decode_short_term_rps Signed-off-by: Michael Niedermayer (cherry picked from commit 6e1f8780c833ef55815111d4771b95ff78567cdb) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bda906a19561f6e4cc60c9dd494eef1669a438b9 --- libavformat/hevc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/hevc.c b/libavformat/hevc.c index c92e9eb..32192ba 100644 --- a/libavformat/hevc.c +++ b/libavformat/hevc.c @@ -449,7 +449,7 @@ static int parse_rps(GetBitContext *gb, unsigned int rps_idx, * * NumDeltaPocs[RefRpsIdx]: num_delta_pocs[rps_idx - 1] */ -for (i = 0; i < num_delta_pocs[rps_idx - 1]; i++) { +for (i = 0; i <= num_delta_pocs[rps_idx - 1]; i++) { uint8_t use_delta_flag = 0; uint8_t used_by_curr_pic_flag = get_bits1(gb); if (!used_by_curr_pic_flag) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libavutil/channel_layout: Correctly return layout when channel specification ends with a trailing ' c'.
ffmpeg | branch: release/2.5 | Simon Thelen | Tue Jun 9 04:55:57 2015 +0200| [fb22fc0c46bb4bee48cdcdf43c8cb1d18aa04e20] | committer: Michael Niedermayer libavutil/channel_layout: Correctly return layout when channel specification ends with a trailing 'c'. Return layout when FF_API_GET_CHANNEL_LAYOUT_COMPAT is set even if the layout itself is not in the deprecated style. Signed-off-by: Simon Thelen Signed-off-by: Michael Niedermayer (cherry picked from commit 83307a32eb0c9f0843f655c44bb65e3e999153f8) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb22fc0c46bb4bee48cdcdf43c8cb1d18aa04e20 --- libavutil/channel_layout.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c index 4c0677f..cd5cf42 100644 --- a/libavutil/channel_layout.c +++ b/libavutil/channel_layout.c @@ -138,8 +138,8 @@ static uint64_t get_channel_layout_single(const char *name, int name_len) "switch to the syntax '%.*sc' otherwise it will be interpreted as a " "channel layout number in a later version\n", name_len, name, name_len, name); -return layout; } +return layout; } } else { #endif ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/jpeg2000dec: Check that coords match before applying ICT
ffmpeg | branch: release/2.5 | Michael Niedermayer | Tue Jun 9 00:37:26 2015 +0200| [062f63e46cd8d4d8094928ce78566e8fb0830aa5] | committer: Michael Niedermayer avcodec/jpeg2000dec: Check that coords match before applying ICT This avoid potential out of array accesses Signed-off-by: Michael Niedermayer (cherry picked from commit 12ba1b2b4d5592c0e27b0fcc83db929e8d6a8eee) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=062f63e46cd8d4d8094928ce78566e8fb0830aa5 --- libavcodec/jpeg2000dec.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 555b3e9..4f5b32f 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1148,11 +1148,16 @@ static inline void mct_decode(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile) int i, csize = 1; void *src[3]; -for (i = 1; i < 3; i++) +for (i = 1; i < 3; i++) { if (tile->codsty[0].transform != tile->codsty[i].transform) { av_log(s->avctx, AV_LOG_ERROR, "Transforms mismatch, MCT not supported\n"); return; } +if (memcmp(tile->comp[0].coord, tile->comp[i].coord, sizeof(tile->comp[0].coord))) { +av_log(s->avctx, AV_LOG_ERROR, "Coords mismatch, MCT not supported\n"); +return; +} +} for (i = 0; i < 3; i++) if (tile->codsty[0].transform == FF_DWT97) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg_opt: Set the video VBV parameters only for the video stream from -target
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon May 25 12:13:53 2015 +0200| [a61759596dc76448d265a66aaa5c3f452d729097] | committer: Michael Niedermayer ffmpeg_opt: Set the video VBV parameters only for the video stream from -target Signed-off-by: Michael Niedermayer (cherry picked from commit 2ce6e419113f8276f417a9a8b50122c5467d9bc5) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a61759596dc76448d265a66aaa5c3f452d729097 --- ffmpeg_opt.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index ad082ac..ea16a11 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -2248,9 +2248,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg) opt_default(NULL, "g", norm == PAL ? "15" : "18"); opt_default(NULL, "b:v", "115"); -opt_default(NULL, "maxrate", "115"); -opt_default(NULL, "minrate", "115"); -opt_default(NULL, "bufsize", "327680"); // 40*1024*8; +opt_default(NULL, "maxrate:v", "115"); +opt_default(NULL, "minrate:v", "115"); +opt_default(NULL, "bufsize:v", "327680"); // 40*1024*8; opt_default(NULL, "b:a", "224000"); parse_option(o, "ar", "44100", options); @@ -2277,9 +2277,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg) opt_default(NULL, "g", norm == PAL ? "15" : "18"); opt_default(NULL, "b:v", "204"); -opt_default(NULL, "maxrate", "2516000"); -opt_default(NULL, "minrate", "0"); // 1145000; -opt_default(NULL, "bufsize", "1835008"); // 224*1024*8; +opt_default(NULL, "maxrate:v", "2516000"); +opt_default(NULL, "minrate:v", "0"); // 1145000; +opt_default(NULL, "bufsize:v", "1835008"); // 224*1024*8; opt_default(NULL, "scan_offset", "1"); opt_default(NULL, "b:a", "224000"); @@ -2299,9 +2299,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg) opt_default(NULL, "g", norm == PAL ? "15" : "18"); opt_default(NULL, "b:v", "600"); -opt_default(NULL, "maxrate", "900"); -opt_default(NULL, "minrate", "0"); // 150; -opt_default(NULL, "bufsize", "1835008"); // 224*1024*8; +opt_default(NULL, "maxrate:v", "900"); +opt_default(NULL, "minrate:v", "0"); // 150; +opt_default(NULL, "bufsize:v", "1835008"); // 224*1024*8; opt_default(NULL, "packetsize", "2048"); // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack. opt_default(NULL, "muxrate", "1008"); // from mplex project: data_rate = 126. mux_rate = data_rate * 8 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/adpcm: Check for overreads
ffmpeg | branch: release/2.5 | Michael Niedermayer | Thu Jun 4 22:34:12 2015 +0200| [cdd594e24ba1729f9850bbefc4b8d87a7adb1740] | committer: Michael Niedermayer avcodec/adpcm: Check for overreads See: vlc ticket 14649 Reported-by: carl Signed-off-by: Michael Niedermayer (cherry picked from commit 3c803ed9cb23e5a8d76b6c31d8a8c71cac27e769) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cdd594e24ba1729f9850bbefc4b8d87a7adb1740 --- libavcodec/adpcm.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 2f95a6f..f7ca208 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -574,6 +574,8 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb, case AV_CODEC_ID_ADPCM_IMA_DK4: if (avctx->block_align > 0) buf_size = FFMIN(buf_size, avctx->block_align); +if (buf_size < 4 * ch) +return AVERROR_INVALIDDATA; nb_samples = 1 + (buf_size - 4 * ch) * 2 / ch; break; case AV_CODEC_ID_ADPCM_IMA_RAD: @@ -587,13 +589,15 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb, int bsamples = ff_adpcm_ima_block_samples[avctx->bits_per_coded_sample - 2]; if (avctx->block_align > 0) buf_size = FFMIN(buf_size, avctx->block_align); +if (buf_size < 4 * ch) +return AVERROR_INVALIDDATA; nb_samples = 1 + (buf_size - 4 * ch) / (bsize * ch) * bsamples; break; } case AV_CODEC_ID_ADPCM_MS: if (avctx->block_align > 0) buf_size = FFMIN(buf_size, avctx->block_align); -nb_samples = 2 + (buf_size - 7 * ch) * 2 / ch; +nb_samples = (buf_size - 6 * ch) * 2 / ch; break; case AV_CODEC_ID_ADPCM_SBPRO_2: case AV_CODEC_ID_ADPCM_SBPRO_3: @@ -606,6 +610,8 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb, case AV_CODEC_ID_ADPCM_SBPRO_4: samples_per_byte = 2; break; } if (!s->status[0].step_index) { +if (buf_size < ch) +return AVERROR_INVALIDDATA; nb_samples++; buf_size -= ch; } @@ -1524,6 +1530,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, *got_frame_ptr = 1; +if (avpkt->size < bytestream2_tell(&gb)) { +av_log(avctx, AV_LOG_ERROR, "Overread of %d < %d\n", avpkt->size, bytestream2_tell(&gb)); +return avpkt->size; +} + return bytestream2_tell(&gb); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swresample/dither: check memory allocation
ffmpeg | branch: release/2.5 | Ganesh Ajjanagadde | Tue Jun 2 23:17:48 2015 -0400| [3dc303a05192b2a7863b4ce4df10646b501ebe4e] | committer: Michael Niedermayer swresample/dither: check memory allocation check memory allocation in swri_get_dither() Signed-off-by: Michael Niedermayer (cherry picked from commit 196b885a5f0aa3ca022c1fa99509f47341239784) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3dc303a05192b2a7863b4ce4df10646b501ebe4e --- libswresample/dither.c |6 +- libswresample/swresample.c |3 ++- libswresample/swresample_internal.h |2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libswresample/dither.c b/libswresample/dither.c index 8121f11..23e7e12 100644 --- a/libswresample/dither.c +++ b/libswresample/dither.c @@ -23,12 +23,15 @@ #include "noise_shaping_data.c" -void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt) { +int swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt) { double scale = s->dither.noise_scale; #define TMP_EXTRA 2 double *tmp = av_malloc_array(len + TMP_EXTRA, sizeof(double)); int i; +if (!tmp) +return AVERROR(ENOMEM); + for(i=0; idither.noise.ch_count; ch++) -swri_get_dither(s, s->dither.noise.ch[ch], s->dither.noise.count, 12345678913579dither.noise.ch[ch], s->dither.noise.count, 12345678913579 dither.noise.ch_count == preout->ch_count); if(s->dither.noise_pos + out_count > s->dither.noise.count) diff --git a/libswresample/swresample_internal.h b/libswresample/swresample_internal.h index 1bc6837..fcc63a6 100644 --- a/libswresample/swresample_internal.h +++ b/libswresample/swresample_internal.h @@ -191,7 +191,7 @@ void swri_rematrix_free(SwrContext *s); int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mustcopy); void swri_rematrix_init_x86(struct SwrContext *s); -void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt); +int swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt); int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt); void swri_audio_convert_init_aarch64(struct AudioConvert *ac, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/atrac3plusdec: consume only as many bytes as available
ffmpeg | branch: release/2.5 | Michael Niedermayer | Thu Jun 4 22:47:24 2015 +0200| [177014a49437869971310c8c6c171255c391a636] | committer: Michael Niedermayer avcodec/atrac3plusdec: consume only as many bytes as available Signed-off-by: Michael Niedermayer (cherry picked from commit 6b6ae7c3ead5dee786a4aea929820076a7c82da4) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=177014a49437869971310c8c6c171255c391a636 --- libavcodec/atrac3plusdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c index 78121e8..50cf74e 100644 --- a/libavcodec/atrac3plusdec.c +++ b/libavcodec/atrac3plusdec.c @@ -383,7 +383,7 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data, *got_frame_ptr = 1; -return avctx->block_align; +return FFMIN(avctx->block_align, avpkt->size); } AVCodec ff_atrac3p_decoder = { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/alsdec: Check for overread
ffmpeg | branch: release/2.5 | Michael Niedermayer | Thu Jun 4 22:59:34 2015 +0200| [5ebae729b9a9cbeb553056eca25a2caedbe03c5d] | committer: Michael Niedermayer avcodec/alsdec: Check for overread Signed-off-by: Michael Niedermayer (cherry picked from commit c2657633187e325a439e3297fd9ccd0522ab2e39) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5ebae729b9a9cbeb553056eca25a2caedbe03c5d --- libavcodec/alsdec.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index a55354b..708c714 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1493,6 +1493,11 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) // TODO: read_diff_float_data +if (get_bits_left(gb) < 0) { +av_log(ctx->avctx, AV_LOG_ERROR, "Overread %d\n", -get_bits_left(gb)); +return AVERROR_INVALIDDATA; +} + return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/ffmdec: Check ffio_set_buf_size() return value
ffmpeg | branch: release/2.5 | Michael Niedermayer | Sun Jun 7 14:55:10 2015 +0200| [057d6e1cd62055c58db1087b553e6beb871509ab] | committer: Michael Niedermayer avformat/ffmdec: Check ffio_set_buf_size() return value Signed-off-by: Michael Niedermayer (cherry picked from commit dc55477a64cefebf8dcc611f026be71382814ae2) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=057d6e1cd62055c58db1087b553e6beb871509ab --- libavformat/ffmdec.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index 33bbde0..57df43b 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -98,7 +98,9 @@ static int ffm_read_data(AVFormatContext *s, retry_read: if (pb->buffer_size != ffm->packet_size) { int64_t tell = avio_tell(pb); -ffio_set_buf_size(pb, ffm->packet_size); +int ret = ffio_set_buf_size(pb, ffm->packet_size); +if (ret < 0) +return ret; avio_seek(pb, tell, SEEK_SET); } id = avio_rb16(pb); /* PACKET_ID */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Revert "avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr dereference"
ffmpeg | branch: release/2.5 | Michael Niedermayer | Wed Jun 3 22:39:27 2015 +0200| [1728aa3442d7e3a18268a9b8ae8fcb5ff914fa33] | committer: Michael Niedermayer Revert "avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr dereference" This was simply wrong Found-by: Martin Storsjö This reverts commit 5d8e4f6da03c0342157e6ac7fab1a8ac3a87a8b0. (cherry picked from commit 3e34b7498f14c04baadde1700a6f73a7e9e86fa6) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1728aa3442d7e3a18268a9b8ae8fcb5ff914fa33 --- libavformat/rtpenc.c |4 1 file changed, 4 deletions(-) diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index c608dfb..cbe0fae 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -576,10 +576,6 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) const uint8_t *mb_info = av_packet_get_side_data(pkt, AV_PKT_DATA_H263_MB_INFO, &mb_info_size); -if (!mb_info) { -av_log(s1, AV_LOG_ERROR, "failed to allocate side data\n"); -return AVERROR(ENOMEM); -} ff_rtp_send_h263_rfc2190(s1, pkt->data, size, mb_info, mb_info_size); break; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libavutil/softfloat: Fix av_normalize1_sf bias.
ffmpeg | branch: release/2.5 | Nedeljko Babic | Wed Jun 3 16:17:39 2015 +0200| [3dd5c6a4ba805f7b6c4c80897571cb14b9aa4496] | committer: Michael Niedermayer libavutil/softfloat: Fix av_normalize1_sf bias. av_normalize1_sf doesn't properly address border case when mantis is exactly -0x4000. Signed-off-by: Michael Niedermayer (cherry picked from commit 7131aba916d1f562bdaf6a81319f1421ce175b1e) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3dd5c6a4ba805f7b6c4c80897571cb14b9aa4496 --- libavutil/softfloat.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index 8647e6a..a487c34 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -59,7 +59,7 @@ static av_const SoftFloat av_normalize_sf(SoftFloat a){ static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){ #if 1 -if((int32_t)(a.mant + 0x4000U) < 0){ +if((int32_t)(a.mant + 0x4000U) <= 0){ a.exp++; a.mant>>=1; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] h264: Make sure reinit failures mark the context as not initialized
ffmpeg | branch: release/2.5 | Luca Barbato | Mon May 25 22:30:10 2015 +0200| [6b2163caabadf3bd5618ce78720035946b5493f3] | committer: Michael Niedermayer h264: Make sure reinit failures mark the context as not initialized (cherry picked from commit 0181ae9af2de1526464d23209b82e6674d362f5d) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6b2163caabadf3bd5618ce78720035946b5493f3 --- libavcodec/h264_slice.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index b667da3..6b1db1a 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1472,6 +1472,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0) if (h->context_initialized && (must_reinit || needs_reinit)) { +h->context_initialized = 0; if (h != h0) { av_log(h->avctx, AV_LOG_ERROR, "changing width %d -> %d / height %d -> %d on " ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] swresample: Check the return value of resampler->init()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Wed Jun 3 00:48:29 2015 +0200| [fd989ff9ca4dfe3fb9b5b41737740d58b6c5a873] | committer: Michael Niedermayer swresample: Check the return value of resampler->init() Signed-off-by: Michael Niedermayer (cherry picked from commit 02915602d9313aa4b108342a3081244b9d2422bf) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fd989ff9ca4dfe3fb9b5b41737740d58b6c5a873 --- libswresample/swresample.c |4 1 file changed, 4 insertions(+) diff --git a/libswresample/swresample.c b/libswresample/swresample.c index a29dc62..c5ac1b3 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -255,6 +255,10 @@ av_cold int swr_init(struct SwrContext *s){ if (s->out_sample_rate!=s->in_sample_rate || (s->flags & SWR_FLAG_RESAMPLE)){ s->resample = s->resampler->init(s->resample, s->out_sample_rate, s->in_sample_rate, s->filter_size, s->phase_shift, s->linear_interp, s->cutoff, s->int_sample_fmt, s->filter_type, s->kaiser_beta, s->precision, s->cheby); +if (!s->resample) { +av_log(s, AV_LOG_ERROR, "Failed to initilaize resampler\n"); +return AVERROR(ENOMEM); +} }else s->resampler->free(&s->resample); if(s->int_sample_fmt != AV_SAMPLE_FMT_S16P ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] libopenjpegenc: add NULL check for img before accessing it
ffmpeg | branch: release/2.5 | Andreas Cadhalpun | Mon Jun 1 00:51:30 2015 +0200| [42c54f8f4dd9b43dcb9cfc484b9f5ce82d1a812e] | committer: Michael Niedermayer libopenjpegenc: add NULL check for img before accessing it If opj_image_create fails to allocate an image it returns NULL, which causes a segmentation fault at 'img->x0 = 0'. Reviewed-by: Michael Niedermayer Signed-off-by: Andreas Cadhalpun (cherry picked from commit 1577526b47439f33a999339efdec5d624b70e1da) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42c54f8f4dd9b43dcb9cfc484b9f5ce82d1a812e --- libavcodec/libopenjpegenc.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index 66633f4..458cf7c 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -164,6 +164,9 @@ static opj_image_t *mj2_create_image(AVCodecContext *avctx, opj_cparameters_t *p img = opj_image_create(numcomps, cmptparm, color_space); +if (!img) +return NULL; + // x0, y0 is the top left corner of the image // x1, y1 is the width, height of the reference grid img->x0 = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon May 25 03:48:45 2015 +0200| [8d98fbef16554c3b889c426c75155823d6be2f37] | committer: Michael Niedermayer avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits() Signed-off-by: Michael Niedermayer (cherry picked from commit 291ad5cc9cf815eb110b062487980fab2d107936) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8d98fbef16554c3b889c426c75155823d6be2f37 --- libavcodec/bitstream.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index d041643..2e102df 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -69,6 +69,8 @@ void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length) if (length == 0) return; +av_assert0(length <= put_bits_left(pb)); + if (CONFIG_SMALL || words < 16 || put_bits_count(pb) & 7) { for (i = 0; i < words; i++) put_bits(pb, 16, AV_RB16(src + 2 * i)); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mpegvideo_enc: Update the buffer size as more slices are merged
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon May 25 04:54:41 2015 +0200| [e83d99863418104adb1ea12825a19343ced5227c] | committer: Michael Niedermayer avcodec/mpegvideo_enc: Update the buffer size as more slices are merged Signed-off-by: Michael Niedermayer (cherry picked from commit 561d3a57aaa95c7e8e65e96b36dd069100603650) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e83d99863418104adb1ea12825a19343ced5227c --- libavcodec/mpegvideo_enc.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index f303a35..dbcbb8a 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -3742,6 +3742,8 @@ static int encode_picture(MpegEncContext *s, int picture_number) } s->avctx->execute(s->avctx, encode_thread, &s->thread_context[0], NULL, context_count, sizeof(void*)); for(i=1; ipb.buf_end == s->thread_context[i]->pb.buf) +set_put_bits_buffer_size(&s->pb, FFMIN(s->thread_context[i]->pb.buf_end - s->pb.buf, INT_MAX/8-32)); merge_context_after_encode(s, s->thread_context[i]); } emms_c(); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/wavdec: Increase probe_packets limit
ffmpeg | branch: release/2.5 | Michael Niedermayer | Sat May 23 12:03:38 2015 +0200| [f1a4af4dc27c41e13e15ff5e7e9f5af3551a1b2e] | committer: Michael Niedermayer avformat/wavdec: Increase probe_packets limit Fixes DTS detection of b2429e5ba9.dts Signed-off-by: Michael Niedermayer (cherry picked from commit 9f5769437aaab30a359cde254f39d9a28b1ce657) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f1a4af4dc27c41e13e15ff5e7e9f5af3551a1b2e --- libavformat/wavdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 9c4e2df..763e2e4 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -114,7 +114,7 @@ static void handle_stream_probing(AVStream *st) { if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) { st->request_probe = AVPROBE_SCORE_EXTENSION; -st->probe_packets = FFMIN(st->probe_packets, 14); +st->probe_packets = FFMIN(st->probe_packets, 20); } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/put_bits: Assert that there is enough space left in skip_put_bytes ()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon May 25 03:45:38 2015 +0200| [4ac8b94a73218aa176226a431a222a1946199e7c] | committer: Michael Niedermayer avcodec/put_bits: Assert that there is enough space left in skip_put_bytes() Signed-off-by: Michael Niedermayer (cherry picked from commit 8f5ffed183e099128a732a00976f69fdc641d093) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ac8b94a73218aa176226a431a222a1946199e7c --- libavcodec/put_bits.h |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h index 8dbbd09..08f6826 100644 --- a/libavcodec/put_bits.h +++ b/libavcodec/put_bits.h @@ -230,6 +230,7 @@ static inline void skip_put_bytes(PutBitContext *s, int n) { av_assert2((put_bits_count(s) & 7) == 0); av_assert2(s->bit_left == 32); +av_assert0(n <= s->buf_end - s->buf_ptr); s->buf_ptr += n; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/put_bits: Update size_in_bits in set_put_bits_buffer_size()
ffmpeg | branch: release/2.5 | Michael Niedermayer | Mon May 25 04:53:09 2015 +0200| [962ad32891c82906cdca3a5e4c3e1d3e92b384bc] | committer: Michael Niedermayer avcodec/put_bits: Update size_in_bits in set_put_bits_buffer_size() Signed-off-by: Michael Niedermayer (cherry picked from commit e4c2ec879b1121c02279cd60a54643da0d249e40) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=962ad32891c82906cdca3a5e4c3e1d3e92b384bc --- libavcodec/put_bits.h |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h index 8858caa..8dbbd09 100644 --- a/libavcodec/put_bits.h +++ b/libavcodec/put_bits.h @@ -253,6 +253,7 @@ static inline void skip_put_bits(PutBitContext *s, int n) static inline void set_put_bits_buffer_size(PutBitContext *s, int size) { s->buf_end = s->buf + size; +s->size_in_bits = 8*size; } #endif /* AVCODEC_PUT_BITS_H */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/wavdec: Increase dts packet threshold to fix more misdetections
ffmpeg | branch: release/2.5 | Rodger Combs | Sat May 23 14:07:14 2015 +0200| [9e1a818a2df1a5c023780bb3d9b0bcafbe7bf20e] | committer: Michael Niedermayer avformat/wavdec: Increase dts packet threshold to fix more misdetections Signed-off-by: Michael Niedermayer (cherry picked from commit 40a3e1e9c54997e4dfc7802b5a758b68ceb64982) Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e1a818a2df1a5c023780bb3d9b0bcafbe7bf20e --- libavformat/wavdec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 763e2e4..66fd766 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -114,7 +114,7 @@ static void handle_stream_probing(AVStream *st) { if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) { st->request_probe = AVPROBE_SCORE_EXTENSION; -st->probe_packets = FFMIN(st->probe_packets, 20); +st->probe_packets = FFMIN(st->probe_packets, 32); } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] ffmpeg: Use side data instead of coded_frame for error[] values
ffmpeg | branch: master | Michael Niedermayer | Tue Jul 28 01:28:34 2015 +0200| [cdb0225fa9e65b61a3a4b5f7975dd467d7e622ab] | committer: Michael Niedermayer ffmpeg: Use side data instead of coded_frame for error[] values Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cdb0225fa9e65b61a3a4b5f7975dd467d7e622ab --- ffmpeg.c | 14 +++--- ffmpeg.h |3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 07c62a4..8107b3c 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -669,9 +669,17 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost) ost->frame_number++; } if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { +int i; uint8_t *sd = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_STATS, NULL); ost->quality = sd ? AV_RL32(sd) : -1; + +for (i = 0; ierror); i++) { +if (sd && i < sd[5]) +ost->error[i] = AV_RL64(sd + 8 + 8*i); +else +ost->error[i] = -1; +} } if (bsfc) @@ -1266,8 +1274,8 @@ static void do_video_stats(OutputStream *ost, int frame_size) fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, ost->quality / (float)FF_QP2LAMBDA); -if (enc->coded_frame && (enc->flags & AV_CODEC_FLAG_PSNR)) -fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0] / (enc->width * enc->height * 255.0 * 255.0))); +if (ost->error[0]>=0 && (enc->flags & AV_CODEC_FLAG_PSNR)) +fprintf(vstats_file, "PSNR= %6.2f ", psnr(ost->error[0] / (enc->width * enc->height * 255.0 * 255.0))); fprintf(vstats_file,"f_size= %6d ", frame_size); /* compute pts value */ @@ -1598,7 +1606,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti error = enc->error[j]; scale = enc->width * enc->height * 255.0 * 255.0 * frame_number; } else { -error = enc->coded_frame->error[j]; +error = ost->error[j]; scale = enc->width * enc->height * 255.0 * 255.0; } if (j) diff --git a/ffmpeg.h b/ffmpeg.h index e43c985..6e2267a 100644 --- a/ffmpeg.h +++ b/ffmpeg.h @@ -459,6 +459,9 @@ typedef struct OutputStream { /* packet quality factor */ int quality; + +/* frame encode sum of squared error values */ +int64_t error[4]; } OutputStream; typedef struct OutputFile { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mpegvideo_enc: export per frame PSNR through side data
ffmpeg | branch: master | Michael Niedermayer | Tue Jul 28 02:13:39 2015 +0200| [27294bc203a4e1de9b8047c340f51c76f8f9a0af] | committer: Michael Niedermayer avcodec/mpegvideo_enc: export per frame PSNR through side data Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=27294bc203a4e1de9b8047c340f51c76f8f9a0af --- libavcodec/mpegvideo_enc.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 05e79c9..e391142 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1831,8 +1831,6 @@ vbv_retry: av_assert0(s->avctx->rc_max_rate); } -ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality, NULL, 0, s->pict_type); - if (s->avctx->flags & AV_CODEC_FLAG_PASS1) ff_write_pass1_stats(s); @@ -1842,6 +1840,10 @@ vbv_retry: s->current_picture.error[i]; avctx->error[i] += s->current_picture_ptr->f->error[i]; } +ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality, + s->current_picture_ptr->f->error, + (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? 4 : 0, + s->pict_type); if (s->avctx->flags & AV_CODEC_FLAG_PASS1) assert(avctx->header_bits + avctx->mv_bits + avctx->misc_bits + ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/snowenc: Export quality/pict_type/PSNR stats through side data
ffmpeg | branch: master | Michael Niedermayer | Tue Jul 28 02:17:39 2015 +0200| [1ca042a14b9347d191eb4abf8dc74ac48db272fd] | committer: Michael Niedermayer avcodec/snowenc: Export quality/pict_type/PSNR stats through side data Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ca042a14b9347d191eb4abf8dc74ac48db272fd --- libavcodec/snowenc.c |5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 134c8c1..16c7e05 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -1850,6 +1850,11 @@ redo_frame: emms_c(); +ff_side_data_set_encoder_stats(pkt, s->current_picture->quality, + s->current_picture->error, + (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? 4 : 0, + s->current_picture->pict_type); + pkt->size = ff_rac_terminate(c); if (s->current_picture->key_frame) pkt->flags |= AV_PKT_FLAG_KEY; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avocdec/mpeg12dec: fix mpeg_xvmc hwaccel flag
ffmpeg | branch: master | James Almer | Mon Jul 27 21:09:53 2015 -0300| [5d95f32bff86bea453e623e7b241b3c5455af896] | committer: James Almer avocdec/mpeg12dec: fix mpeg_xvmc hwaccel flag The flag is deprecated and as such didn't get a new AV_ prefixed version Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5d95f32bff86bea453e623e7b241b3c5455af896 --- libavcodec/mpeg12dec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 363ce61..73ebdfa 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -2917,7 +2917,7 @@ AVCodec ff_mpeg_xvmc_decoder = { .close = mpeg_decode_end, .decode = mpeg_decode_frame, .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | - AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_HWACCEL | + AV_CODEC_CAP_TRUNCATED | CODEC_CAP_HWACCEL | AV_CODEC_CAP_DELAY, .flush = flush, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/mpegvideo_enc: move ff_side_data_set_encoder_stats() call to after the vbv retry code
ffmpeg | branch: master | Michael Niedermayer | Tue Jul 28 01:04:55 2015 +0200| [360cebc9c82c24abd92e8aee5e6d4819082431e1] | committer: Michael Niedermayer avcodec/mpegvideo_enc: move ff_side_data_set_encoder_stats() call to after the vbv retry code This ensures the data matches the final values Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=360cebc9c82c24abd92e8aee5e6d4819082431e1 --- libavcodec/mpegvideo_enc.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 002843a..05e79c9 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1789,8 +1789,6 @@ vbv_retry: frame_end(s); -ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality, NULL, 0, s->pict_type); - if (CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG) ff_mjpeg_encode_picture_trailer(&s->pb, s->header_bits); @@ -1833,6 +1831,8 @@ vbv_retry: av_assert0(s->avctx->rc_max_rate); } +ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality, NULL, 0, s->pict_type); + if (s->avctx->flags & AV_CODEC_FLAG_PASS1) ff_write_pass1_stats(s); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'b7040e67ec18259ca634a0e29d98469b3484a87c'
ffmpeg | branch: master | Michael Niedermayer | Tue Jul 28 00:27:37 2015 +0200| [ea7e4f8e6aa2500716b55a1d9ad247bca1cd1174] | committer: Michael Niedermayer Merge commit 'b7040e67ec18259ca634a0e29d98469b3484a87c' * commit 'b7040e67ec18259ca634a0e29d98469b3484a87c': h264: fix AVDISCARD_NONKEY for some interlaced content Conflicts: libavcodec/h264.c Not merged, the used field is not initialized where it is used Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea7e4f8e6aa2500716b55a1d9ad247bca1cd1174 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] h264: fix AVDISCARD_NONKEY for some interlaced content
ffmpeg | branch: master | John Högberg | Fri Jul 24 15:30:38 2015 +0200| [b7040e67ec18259ca634a0e29d98469b3484a87c] | committer: Anton Khirnov h264: fix AVDISCARD_NONKEY for some interlaced content When skip_frame is set to _NONKEY the decoder skips everything except intra slices, which breaks frames that consist of an intra field together with any other field type; half the frame becomes garbage. This patch fixes the issue by letting non-intra slices through if they're part of a keyframe. Signed-off-by: Anton Khirnov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b7040e67ec18259ca634a0e29d98469b3484a87c --- libavcodec/h264.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index eb4edb9..7c2b307 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1507,7 +1507,7 @@ again: (avctx->skip_frame < AVDISCARD_BIDIR || sl->slice_type_nos != AV_PICTURE_TYPE_B) && (avctx->skip_frame < AVDISCARD_NONKEY || - sl->slice_type_nos == AV_PICTURE_TYPE_I) && + h->cur_pic_ptr->f->key_frame) && avctx->skip_frame < AVDISCARD_ALL) { if (avctx->hwaccel) { ret = avctx->hwaccel->decode_slice(avctx, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'db21dde3f72c2331653399bdb8745350f015d847'
ffmpeg | branch: master | Michael Niedermayer | Tue Jul 28 00:13:14 2015 +0200| [4ecc9a2f31bfafd5438558311f858ad4c7138214] | committer: Michael Niedermayer Merge commit 'db21dde3f72c2331653399bdb8745350f015d847' * commit 'db21dde3f72c2331653399bdb8745350f015d847': qsvdec_mpeg2: drop an incorrect comment Conflicts: libavcodec/qsvdec_mpeg2.c No change as the removed comment was not in libavcodec/qsvdec_mpeg2.c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ecc9a2f31bfafd5438558311f858ad4c7138214 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] qsvdec_mpeg2: drop an incorrect comment
ffmpeg | branch: master | Anton Khirnov | Mon Jul 27 08:01:09 2015 +0200| [db21dde3f72c2331653399bdb8745350f015d847] | committer: Anton Khirnov qsvdec_mpeg2: drop an incorrect comment It got copypasted from the h264 decoder, but it does not apply to mpeg2. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=db21dde3f72c2331653399bdb8745350f015d847 --- libavcodec/qsvdec_mpeg2.c |1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/qsvdec_mpeg2.c b/libavcodec/qsvdec_mpeg2.c index 31bdf92..98318bd 100644 --- a/libavcodec/qsvdec_mpeg2.c +++ b/libavcodec/qsvdec_mpeg2.c @@ -114,7 +114,6 @@ static int qsv_decode_frame(AVCodecContext *avctx, void *data, /* process buffered data */ while (!*got_frame) { -/* prepare the input data -- convert to Annex B if needed */ if (s->input_ref.size <= 0) { /* no more data */ if (av_fifo_size(s->packet_fifo) < sizeof(AVPacket)) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'b5c1c16247ab7d166c84eaf4564e49a1535fdaaf'
ffmpeg | branch: master | Michael Niedermayer | Tue Jul 28 00:13:51 2015 +0200| [e1296b5fa4e54941dcc68136022d71dfff01e214] | committer: Michael Niedermayer Merge commit 'b5c1c16247ab7d166c84eaf4564e49a1535fdaaf' * commit 'b5c1c16247ab7d166c84eaf4564e49a1535fdaaf': asfdec: do not align Data Object when Broadcast Flag is set Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1296b5fa4e54941dcc68136022d71dfff01e214 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] asfdec: do not align Data Object when Broadcast Flag is set
ffmpeg | branch: master | Alexandra Hájková | Thu Jul 23 12:33:37 2015 +0200| [b5c1c16247ab7d166c84eaf4564e49a1535fdaaf] | committer: Anton Khirnov asfdec: do not align Data Object when Broadcast Flag is set its size is invalid in this case Signed-off-by: Anton Khirnov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b5c1c16247ab7d166c84eaf4564e49a1535fdaaf --- libavformat/asfdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 9c746af..37d91e0 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -928,7 +928,7 @@ static int asf_read_data(AVFormatContext *s, const GUIDParseTable *g) size, asf->nb_packets); avio_skip(pb, 2); // skip reserved field asf->first_packet_offset = avio_tell(pb); -if (pb->seekable) +if (pb->seekable && !(asf->b_flags & ASF_FLAG_BROADCAST)) align_position(pb, asf->offset, asf->data_size); return 0; @@ -1676,7 +1676,7 @@ static int asf_read_header(AVFormatContext *s) size = avio_rl64(pb); align_position(pb, asf->offset, size); } -if (asf->data_reached && !pb->seekable) +if (asf->data_reached && (!pb->seekable || (asf->b_flags & ASF_FLAG_BROADCAST))) break; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'abdc7e403e003e97a0dcc4499ac319bf854aeead'
ffmpeg | branch: master | Michael Niedermayer | Tue Jul 28 00:04:02 2015 +0200| [146730480265dc2ce23f18a15b9edf2129b54185] | committer: Michael Niedermayer Merge commit 'abdc7e403e003e97a0dcc4499ac319bf854aeead' * commit 'abdc7e403e003e97a0dcc4499ac319bf854aeead': fate: Add hap-chunk ref file Conflicts: tests/ref/fate/hap-chunk See: c7e6443441ed5c1b5f64067dfbf4956bc2c6acbb Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=146730480265dc2ce23f18a15b9edf2129b54185 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'aaf937ee3557bfb99c2ad298591b22a7f22ecbf7'
ffmpeg | branch: master | Michael Niedermayer | Tue Jul 28 00:02:37 2015 +0200| [952e9fbb4aaa7d424847e64514973d749d2fc931] | committer: Michael Niedermayer Merge commit 'aaf937ee3557bfb99c2ad298591b22a7f22ecbf7' * commit 'aaf937ee3557bfb99c2ad298591b22a7f22ecbf7': hap: Add utility functions file Conflicts: libavcodec/hap.c No change, no files are/where missing in FFmpeg Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=952e9fbb4aaa7d424847e64514973d749d2fc931 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] fate: Add hap-chunk ref file
ffmpeg | branch: master | Vittorio Giovara | Mon Jul 27 16:56:12 2015 +0100| [abdc7e403e003e97a0dcc4499ac319bf854aeead] | committer: Vittorio Giovara fate: Add hap-chunk ref file Missing from the push of 3ee217853a6741b829a2683f49c590618891b1ab. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=abdc7e403e003e97a0dcc4499ac319bf854aeead --- tests/ref/fate/hap-chunk |2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ref/fate/hap-chunk b/tests/ref/fate/hap-chunk new file mode 100644 index 000..4f09d43 --- /dev/null +++ b/tests/ref/fate/hap-chunk @@ -0,0 +1,2 @@ +#tb 0: 1/15360 +0, 0, 0,0,16384, 0x096d409e ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hap: Add utility functions file
ffmpeg | branch: master | Vittorio Giovara | Mon Jul 27 16:20:29 2015 +0100| [aaf937ee3557bfb99c2ad298591b22a7f22ecbf7] | committer: Vittorio Giovara hap: Add utility functions file Missing from the push of 3ee217853a6741b829a2683f49c590618891b1ab. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aaf937ee3557bfb99c2ad298591b22a7f22ecbf7 --- libavcodec/hap.c | 55 ++ 1 file changed, 55 insertions(+) diff --git a/libavcodec/hap.c b/libavcodec/hap.c new file mode 100644 index 000..770142c --- /dev/null +++ b/libavcodec/hap.c @@ -0,0 +1,55 @@ +/* + * Vidvox Hap utility functions + * Copyright (C) 2015 Tom Butterworth + * + * This file is part of Libav. + * + * Libav 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. + * + * Libav 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 Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Hap utilities + */ +#include "hap.h" + +int ff_hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame) +{ +int ret = 0; +if (first_in_frame == 1 && ctx->chunk_count != count) { +int ret = av_reallocp_array(&ctx->chunks, count, sizeof(HapChunk)); +if (ret == 0) +ret = av_reallocp_array(&ctx->chunk_results, count, sizeof(int)); +if (ret < 0) { +ctx->chunk_count = 0; +} else { +ctx->chunk_count = count; +} +} else if (ctx->chunk_count != count) { +/* If this is not the first chunk count calculated for a frame and a + * different count has already been encountered, then reject the frame: + * each table in the Decode Instructions Container must describe the + * same number of chunks. */ +ret = AVERROR_INVALIDDATA; +} +return ret; +} + +av_cold void ff_hap_free_context(HapContext *ctx) +{ +av_freep(&ctx->tex_buf); +av_freep(&ctx->chunks); +av_freep(&ctx->chunk_results); +} ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '3ee217853a6741b829a2683f49c590618891b1ab'
ffmpeg | branch: master | Michael Niedermayer | Mon Jul 27 23:47:01 2015 +0200| [4be1b6bef09737cef8173b619132fa13bef80818] | committer: Michael Niedermayer Merge commit '3ee217853a6741b829a2683f49c590618891b1ab' * commit '3ee217853a6741b829a2683f49c590618891b1ab': Support the Hap chunked frame format Conflicts: libavcodec/hap.h libavcodec/hapdec.c libavcodec/version.h See: c7e6443441ed5c1b5f64067dfbf4956bc2c6acbb Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4be1b6bef09737cef8173b619132fa13bef80818 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Support the Hap chunked frame format
ffmpeg | branch: master | Tom Butterworth | Thu Jul 23 14:39:29 2015 -0400| [3ee217853a6741b829a2683f49c590618891b1ab] | committer: Vittorio Giovara Support the Hap chunked frame format Signed-off-by: Vittorio Giovara > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ee217853a6741b829a2683f49c590618891b1ab --- libavcodec/Makefile |4 +- libavcodec/hap.h | 38 ++- libavcodec/hapdec.c | 273 +++--- libavcodec/hapenc.c | 191 +-- libavcodec/version.h |2 +- tests/fate/video.mak |3 + 6 files changed, 414 insertions(+), 97 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 40f653b..a6e88c7 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -243,8 +243,8 @@ OBJS-$(CONFIG_H264_MMAL_DECODER) += mmaldec.o OBJS-$(CONFIG_H264_NVENC_ENCODER) += nvenc_h264.o OBJS-$(CONFIG_H264_QSV_DECODER)+= qsvdec_h2645.o OBJS-$(CONFIG_H264_QSV_ENCODER)+= qsvenc_h264.o -OBJS-$(CONFIG_HAP_DECODER) += hapdec.o -OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o +OBJS-$(CONFIG_HAP_DECODER) += hapdec.o hap.o +OBJS-$(CONFIG_HAP_ENCODER) += hapenc.o hap.o OBJS-$(CONFIG_HEVC_DECODER)+= hevc.o hevc_mvs.o hevc_ps.o hevc_sei.o \ hevc_cabac.o hevc_refs.o hevcpred.o \ hevcdsp.o hevc_filter.o hevc_parse.o hevc_data.o diff --git a/libavcodec/hap.h b/libavcodec/hap.h index a0fc2e0..9d847f7 100644 --- a/libavcodec/hap.h +++ b/libavcodec/hap.h @@ -1,6 +1,7 @@ /* * Vidvox Hap * Copyright (C) 2015 Vittorio Giovara + * Copyright (C) 2015 Tom Butterworth * * This file is part of Libav. * @@ -41,20 +42,39 @@ enum HapCompressor { HAP_COMP_COMPLEX = 0xC0, }; +enum HapSectionType { +HAP_ST_DECODE_INSTRUCTIONS = 0x01, +HAP_ST_COMPRESSOR_TABLE= 0x02, +HAP_ST_SIZE_TABLE = 0x03, +HAP_ST_OFFSET_TABLE= 0x04, +}; + +typedef struct HapChunk { +enum HapCompressor compressor; +int compressed_offset; +size_t compressed_size; +int uncompressed_offset; +size_t uncompressed_size; +} HapChunk; + typedef struct HapContext { AVClass *class; TextureDSPContext dxtc; GetByteContext gbc; -int section_type;/* Header type */ +enum HapTextureFormat opt_tex_fmt; /* Texture type (encoder only) */ +int opt_chunk_count; /* User-requested chunk count (encoder only) */ + +int chunk_count; +HapChunk *chunks; +int *chunk_results; /* Results from threaded operations */ int tex_rat; /* Compression ratio */ const uint8_t *tex_data; /* Compressed texture */ -uint8_t *tex_buf;/* Uncompressed texture */ +uint8_t *tex_buf;/* Buffer for compressed texture */ size_t tex_size; /* Size of the compressed texture */ -uint8_t *snappied; /* Buffer interacting with snappy */ size_t max_snappy; /* Maximum compressed size for snappy buffer */ int slice_count; /* Number of slices for threaded operations */ @@ -63,4 +83,16 @@ typedef struct HapContext { int (*tex_fun)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block); } HapContext; +/* + * Set the number of chunks in the frame. Returns 0 on success or an error if: + * - first_in_frame is 0 and the number of chunks has changed + * - any other error occurs + */ +int ff_hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame); + +/* + * Free resources associated with the context + */ +av_cold void ff_hap_free_context(HapContext *ctx); + #endif /* AVCODEC_HAP_H */ diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c index 46dda04..8f5365b 100644 --- a/libavcodec/hapdec.c +++ b/libavcodec/hapdec.c @@ -1,6 +1,7 @@ /* * Vidvox Hap decoder * Copyright (C) 2015 Vittorio Giovara + * Copyright (C) 2015 Tom Butterworth * * This file is part of Libav. * @@ -36,6 +37,7 @@ #include "bytestream.h" #include "hap.h" #include "internal.h" +#include "memory.h" #include "snappy.h" #include "texturedsp.h" #include "thread.h" @@ -43,85 +45,224 @@ /* The first three bytes are the size of the section past the header, or zero * if the length is stored in the next long word. The fourth byte in the first * long word indicates the type of the current section. */ -static int parse_section_header(AVCodecContext *avctx) +static int parse_section_header(GetByteContext *gbc, int *section_size, +enum HapSectionType *section_type) { -HapContext *ctx = avctx->priv_data; -GetByteContext *gbc = &ctx->gbc; -int length; - if (bytestream2_get_bytes_left(gbc) < 4) return AVERROR_INVALIDDATA; -length = bytestream2_get_le24(gbc); +*section_size = bytestream2_get_le24(gbc); +*section_type = bytestream2_get_byte(gbc); -ctx->se
[FFmpeg-cvslog] hap: Move some per-stream setup into decoder init rather than per-frame
ffmpeg | branch: master | Tom Butterworth | Thu Jul 23 14:37:08 2015 -0400| [43dd004747fa697396b47d034a80e069facbea09] | committer: Vittorio Giovara hap: Move some per-stream setup into decoder init rather than per-frame This change will reject frames with a texture type which does not match the stream description. Signed-off-by: Vittorio Giovara > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=43dd004747fa697396b47d034a80e069facbea09 --- libavcodec/hapdec.c | 49 - 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c index 71f7db5..46dda04 100644 --- a/libavcodec/hapdec.c +++ b/libavcodec/hapdec.c @@ -74,29 +74,14 @@ static int setup_texture(AVCodecContext *avctx, size_t length) HapContext *ctx = avctx->priv_data; GetByteContext *gbc = &ctx->gbc; int64_t snappy_size; -const char *texture_name; const char *compressorstr; int ret; -switch (ctx->section_type & 0x0F) { -case HAP_FMT_RGBDXT1: -ctx->tex_rat = 8; -ctx->tex_fun = ctx->dxtc.dxt1_block; -texture_name = "DXT1"; -break; -case HAP_FMT_RGBADXT5: -ctx->tex_rat = 16; -ctx->tex_fun = ctx->dxtc.dxt5_block; -texture_name = "DXT5"; -break; -case HAP_FMT_YCOCGDXT5: -ctx->tex_rat = 16; -ctx->tex_fun = ctx->dxtc.dxt5ys_block; -texture_name = "DXT5-YCoCg-scaled"; -break; -default: +if ((avctx->codec_tag == MKTAG('H','a','p','1') && (ctx->section_type & 0x0F) != HAP_FMT_RGBDXT1) || +(avctx->codec_tag == MKTAG('H','a','p','5') && (ctx->section_type & 0x0F) != HAP_FMT_RGBADXT5) || +(avctx->codec_tag == MKTAG('H','a','p','Y') && (ctx->section_type & 0x0F) != HAP_FMT_YCOCGDXT5)) { av_log(avctx, AV_LOG_ERROR, - "Invalid format mode %02X.\n", ctx->section_type); + "Invalid texture format %#04x.\n", ctx->section_type & 0x0F); return AVERROR_INVALIDDATA; } @@ -135,8 +120,7 @@ static int setup_texture(AVCodecContext *avctx, size_t length) return AVERROR_INVALIDDATA; } -av_log(avctx, AV_LOG_DEBUG, "%s texture with %s compressor\n", - texture_name, compressorstr); +av_log(avctx, AV_LOG_DEBUG, "%s compressor\n", compressorstr); return 0; } @@ -220,6 +204,7 @@ static int hap_decode(AVCodecContext *avctx, void *data, static av_cold int hap_init(AVCodecContext *avctx) { HapContext *ctx = avctx->priv_data; +const char *texture_name; int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx); if (ret < 0) { @@ -237,6 +222,28 @@ static av_cold int hap_init(AVCodecContext *avctx) ff_texturedsp_init(&ctx->dxtc); +switch (avctx->codec_tag) { +case MKTAG('H','a','p','1'): +texture_name = "DXT1"; +ctx->tex_rat = 8; +ctx->tex_fun = ctx->dxtc.dxt1_block; +break; +case MKTAG('H','a','p','5'): +texture_name = "DXT5"; +ctx->tex_rat = 16; +ctx->tex_fun = ctx->dxtc.dxt5_block; +break; +case MKTAG('H','a','p','Y'): +texture_name = "DXT5-YCoCg-scaled"; +ctx->tex_rat = 16; +ctx->tex_fun = ctx->dxtc.dxt5ys_block; +break; +default: +return AVERROR_DECODER_NOT_FOUND; +} + +av_log(avctx, AV_LOG_DEBUG, "%s texture\n", texture_name); + ctx->slice_count = av_clip(avctx->thread_count, 1, avctx->coded_height / TEXTURE_BLOCK_H); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '43dd004747fa697396b47d034a80e069facbea09'
ffmpeg | branch: master | Michael Niedermayer | Mon Jul 27 23:36:37 2015 +0200| [f01e3c5d000d264b2935e186594a37a3c00f9465] | committer: Michael Niedermayer Merge commit '43dd004747fa697396b47d034a80e069facbea09' * commit '43dd004747fa697396b47d034a80e069facbea09': hap: Move some per-stream setup into decoder init rather than per-frame Conflicts: libavcodec/hapdec.c See: 6074956fa1d2617ac602e49931b06df0a751370e Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f01e3c5d000d264b2935e186594a37a3c00f9465 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit 'b94ec30428b9696f99b08055735689623fe63954'
ffmpeg | branch: master | Michael Niedermayer | Mon Jul 27 23:21:23 2015 +0200| [e3ec2cde2c394af6c9b64bccd39bc206a88a4e58] | committer: Michael Niedermayer Merge commit 'b94ec30428b9696f99b08055735689623fe63954' * commit 'b94ec30428b9696f99b08055735689623fe63954': lavc: Update version and APIchanges Conflicts: doc/APIchanges libavcodec/avcodec.h libavcodec/version.h Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e3ec2cde2c394af6c9b64bccd39bc206a88a4e58 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog