Commit Graph

119 Commits

Author SHA1 Message Date
Ganesh Ajjanagadde 93afb338a4 lavfi/formats: fix segfault when allocation fails
This is a somewhat subtle failure that can occur when the realloc_array
fails in FORMATS_REF.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-11 10:21:47 -05:00
Ganesh Ajjanagadde 6aaac24d72 avfilter/all: propagate errors of functions from avfilter/formats
Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM).
This propagates the return values.

All of these were found by using av_warn_unused_result, demonstrating its utility.

Tested with FATE. I am least sure of the changes to avfilter/filtergraph,
since I don't know what/how reduce_format is intended to behave and how it should
react to errors.

Fixes: CID 1325680, 1325679, 1325678.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Previous version Reviewed-by: Nicolas George <george@nsup.org>
Previous version Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-14 10:04:01 -04:00
Hendrik Leppkes c36e85b3d9 Merge commit 'ae25413daf42a06f078ed81bb545ec23a8e0b482'
* commit 'ae25413daf42a06f078ed81bb545ec23a8e0b482':
  lavfi: do not exclude hwaccel formats from ff_all_formats()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-29 13:48:58 +02:00
Anton Khirnov ae25413daf lavfi: do not exclude hwaccel formats from ff_all_formats()
It should be possible to pass hwaccel frames through lavfi.
2015-09-28 15:42:38 +02:00
Simon Thelen 7cbb52ecab libavfilter/formats: Fix parsing of channel specifications with a trailing 'c'.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-20 19:51:14 +02:00
Michael Niedermayer 50ee17340b avfilter/formats: Add test for ff_parse_channel_layout()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-20 14:26:34 +02:00
Clément Bœsch 545b0dd6aa avfilter/formats: proper error handling in ff_set_common_*() functions 2015-03-16 23:43:12 +01:00
Clément Bœsch f861d9b2c6 avfilter/formats: proper error handling in ff_channel_layouts_ref() and ff_formats_ref()
Also make sure the allocation and its check are properly done.
2015-03-16 23:43:12 +01:00
Clément Bœsch 93d9ce7cec avfilter/formats: use av_realloc_array in ADD_FORMAT() 2015-03-16 23:43:12 +01:00
Clément Bœsch 38fb183b12 avfilter/formats: remove unused COPY_INT_LIST() macro
This macro is unused since 247fa6c27c.
2015-03-16 23:43:12 +01:00
Michael Niedermayer 9f8f2bcab6 Merge commit 'c3bd1d60af97e8d2568dac9fcce7bdabb4ff93c8'
* commit 'c3bd1d60af97e8d2568dac9fcce7bdabb4ff93c8':
  formats: Check memory allocations

Conflicts:
	libavfilter/formats.c

See: 527ca3985c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-12 22:40:56 +01:00
Vittorio Giovara c3bd1d60af formats: Check memory allocations 2015-03-12 17:46:47 +00:00
Michael Niedermayer b9ffafbfcc avfilter/formats: Alloc NULL fmts in SET_COMMON_FORMATS()
This avoids null pointer dereferences in case memory allocation has failed

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-21 22:15:32 +01:00
Michael Niedermayer 75819fafd8 avfilter/formats: free the correct pointer in ADD_FORMAT()
Also only free it when it was not previously allocated to return to the
state prior to the failing function call

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-21 22:13:44 +01:00
Michael Niedermayer 42f3cb419a Merge commit '863ee8a855b8ce27ffef41479eb66da58763faed'
* commit '863ee8a855b8ce27ffef41479eb66da58763faed':
  lavfi: clean memory on error in ADD_FORMAT()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-21 22:12:46 +01:00
Vittorio Giovara 863ee8a855 lavfi: clean memory on error in ADD_FORMAT()
CC: libav-stable@libav.org
Bug-Id: CID 1250334
2014-11-21 12:27:07 +00:00
Michael Niedermayer 0a7ad6bf51 avfilter/formats: Use av_realloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-13 23:15:16 +02:00
Michael Niedermayer 1853e2cba9 avfilter/formats: Avoid using non public AV_SAMPLE_FMT_NB
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-27 18:22:09 +02:00
Michael Niedermayer 64fb19cc99 avfilter/formats: Avoid using non public AV_PIX_FMT_NB
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-27 17:43:03 +02:00
Michael Niedermayer a1cb4efd2f Merge commit '7cc4c9f32f446feaec5447e3d097e8147e35f156'
* commit '7cc4c9f32f446feaec5447e3d097e8147e35f156':
  lavfi/formats: avoid using AV_{PIX,SAMPLE}_FMT_NB

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-27 03:23:23 +02:00
Anton Khirnov 7cc4c9f32f lavfi/formats: avoid using AV_{PIX,SAMPLE}_FMT_NB
Thatt hardcodes the number of formats into lavfi and will break when a
shared lavu is updated, adding new formats.
2014-05-26 22:25:47 +02:00
Nicolas George 6e2473edfd lavfi: parsing helper for unknown channel layouts.
Make ff_parse_channel_layout() accept unknown layouts too.
2013-11-03 10:30:25 +01:00
Michael Niedermayer 247fa6c27c avfilter: remove ff_copy_int*_list
The functions are unused

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-16 16:07:29 +02:00
Michael Niedermayer 74cb7ef851 Merge commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0'
* commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0':
  lavfi: rename AVFilterFormats.format_count to nb_formats

Conflicts:
	libavfilter/avfiltergraph.c
	libavfilter/filtfmts.c
	libavfilter/formats.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-18 11:46:09 +02:00
Anton Khirnov b01f6041f4 lavfi: rename AVFilterFormats.format_count to nb_formats
This is more consistent with naming in the rest of Libav.
2013-05-17 20:29:50 +02:00
Michael Niedermayer c7c71f95f8 replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_*
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-15 11:23:14 +02:00
Michael Niedermayer ff4680922f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_*

Conflicts:
	doc/APIchanges
	libavcodec/avpicture.c
	libavcodec/ffv1dec.c
	libavcodec/ffv1enc.c
	libavcodec/imgconvert.c
	libavcodec/tiffenc.c
	libavfilter/vf_pixdesctest.c
	libavfilter/vf_scale.c
	libavutil/imgutils.c
	libavutil/pixdesc.c
	libavutil/version.h
	libswscale/swscale_internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-15 11:10:09 +02:00
Anton Khirnov e6c4ac7b5f pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_* 2013-05-15 07:46:51 +02:00
Nicolas George f810ca63f8 lavfi: detect merge failure for unknown layouts.
Detect when filtering known layouts from an explicit list
results in an empty list.

Fix erratic behavior.
2013-04-01 10:37:48 +02:00
Nicolas George e568d432b1 lavfi/formats: reindent after last commit. 2013-02-24 12:05:06 +01:00
Nicolas George 2d98dd3d14 lavfi: fix merging of formats and clarify exception.
The following commit:
b97d61f avfilter/ff_merge_formats: only merge if doing so does not loose chroma or alpha
introduced an exception to avoid lossy conversions.
Add a comment to explain the logic.
Fix the call to avoid applying it on audio formats.
2013-02-24 11:58:52 +01:00
Michael Niedermayer b97d61f924 avfilter/ff_merge_formats: only merge if doing so does not loose chroma or alpha
Fixes Ticket1280

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-19 15:00:01 +01:00
Nicolas George b6b2f3433c lavfi: implement ff_query_formats_all(). 2013-01-26 11:15:38 +01:00
Nicolas George 7bb98b753b lavfi: implement ff_all_channel_counts(). 2013-01-26 11:15:38 +01:00
Nicolas George b6afb2dde1 lavfi: support unknown channel layouts. 2013-01-26 11:15:38 +01:00
Michael Niedermayer 0efcf16a3e replace av_log(0, by av_log(NULL,
The first parameter is a pointer and NULL is more correct

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-23 18:10:02 +01:00
Paul B Mahol 1acd2f6ba7 Replace rest of libavutil/audioconvert.h with libavutil/channel_layout.h
Also remove it in once case when it is not needed.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-11-13 13:21:21 +00:00
Michael Niedermayer 13afee951a Merge commit '59ee9f78b0cc4fb84ae606fa317d8102ad32a627'
* commit '59ee9f78b0cc4fb84ae606fa317d8102ad32a627':
  lavfi: do not use av_pix_fmt_descriptors directly.

Conflicts:
	libavfilter/buffersrc.c
	libavfilter/drawutils.c
	libavfilter/filtfmts.c
	libavfilter/vf_ass.c
	libavfilter/vf_boxblur.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_lut.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vf_showinfo.c
	libavfilter/vf_transpose.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-12 17:04:58 +02:00
Anton Khirnov 59ee9f78b0 lavfi: do not use av_pix_fmt_descriptors directly. 2012-10-12 12:45:39 +02:00
Michael Niedermayer ac627b3d38 Merge commit '716d413c13981da15323c7a3821860536eefdbbb'
* commit '716d413c13981da15323c7a3821860536eefdbbb':
  Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat

Conflicts:
	doc/examples/muxing.c
	ffmpeg.h
	ffmpeg_filter.c
	ffmpeg_opt.c
	ffplay.c
	ffprobe.c
	libavcodec/8bps.c
	libavcodec/aasc.c
	libavcodec/aura.c
	libavcodec/avcodec.h
	libavcodec/avs.c
	libavcodec/bfi.c
	libavcodec/bmp.c
	libavcodec/bmpenc.c
	libavcodec/c93.c
	libavcodec/cscd.c
	libavcodec/cyuv.c
	libavcodec/dpx.c
	libavcodec/dpxenc.c
	libavcodec/eatgv.c
	libavcodec/escape124.c
	libavcodec/ffv1.c
	libavcodec/flashsv.c
	libavcodec/fraps.c
	libavcodec/h264.c
	libavcodec/huffyuv.c
	libavcodec/iff.c
	libavcodec/imgconvert.c
	libavcodec/indeo3.c
	libavcodec/kmvc.c
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/libx264.c
	libavcodec/ljpegenc.c
	libavcodec/mjpegdec.c
	libavcodec/mjpegenc.c
	libavcodec/motionpixels.c
	libavcodec/mpeg12.c
	libavcodec/mpeg12enc.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pamenc.c
	libavcodec/pcxenc.c
	libavcodec/pgssubdec.c
	libavcodec/pngdec.c
	libavcodec/pngenc.c
	libavcodec/pnm.c
	libavcodec/pnmdec.c
	libavcodec/pnmenc.c
	libavcodec/ptx.c
	libavcodec/qdrw.c
	libavcodec/qpeg.c
	libavcodec/qtrleenc.c
	libavcodec/raw.c
	libavcodec/rawdec.c
	libavcodec/rl2.c
	libavcodec/sgidec.c
	libavcodec/sgienc.c
	libavcodec/snowdec.c
	libavcodec/snowenc.c
	libavcodec/sunrast.c
	libavcodec/targa.c
	libavcodec/targaenc.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/tmv.c
	libavcodec/truemotion2.c
	libavcodec/utils.c
	libavcodec/vb.c
	libavcodec/vp3.c
	libavcodec/wnv1.c
	libavcodec/xl.c
	libavcodec/xwddec.c
	libavcodec/xwdenc.c
	libavcodec/yop.c
	libavdevice/v4l2.c
	libavdevice/x11grab.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/buffersrc.c
	libavfilter/drawutils.c
	libavfilter/formats.c
	libavfilter/src_movie.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_format.c
	libavfilter/vf_hflip.c
	libavfilter/vf_lut.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vf_transpose.c
	libavfilter/vf_yadif.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/movenc.c
	libavformat/mxf.h
	libavformat/utils.c
	libavformat/yuv4mpeg.c
	libavutil/imgutils.c
	libavutil/pixdesc.c
	libswscale/input.c
	libswscale/output.c
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c
	libswscale/utils.c
	libswscale/x86/swscale_template.c
	libswscale/x86/yuv2rgb.c
	libswscale/x86/yuv2rgb_template.c
	libswscale/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-08 21:06:57 +02:00
Anton Khirnov 716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Michael Niedermayer c581cb4e4f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Fix even more missing includes after the common.h removal
  build: Factor out rangecoder dependencies to CONFIG_RANGECODER
  build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
  x86: avcodec: Consistently name all init files
  Add more missing includes after removing the implicit common.h
  Add some more missing includes after removing the implicit common.h
  Don't include common.h from avutil.h
  rtmp: Automatically compute the hash for SWFVerification

Conflicts:
	configure
	doc/APIchanges
	doc/examples/decoding_encoding.c
	libavcodec/Makefile
	libavcodec/assdec.c
	libavcodec/audio_frame_queue.c
	libavcodec/avpacket.c
	libavcodec/dv_profile.c
	libavcodec/dwt.c
	libavcodec/libtheoraenc.c
	libavcodec/rawdec.c
	libavcodec/rv40dsp.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/v210dec.h
	libavcodec/vc1dsp.c
	libavcodec/x86/Makefile
	libavfilter/asrc_anullsrc.c
	libavfilter/avfilter.c
	libavfilter/buffer.c
	libavfilter/formats.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_select.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/version.h
	libavutil/audioconvert.c
	libavutil/error.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-16 16:20:30 +02:00
Martin Storsjö 1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03:00
Michael Niedermayer 5916bc4658 Merge commit '1961e46c15c23a041f8d8614a25388a3ee9eff63'
* commit '1961e46c15c23a041f8d8614a25388a3ee9eff63':
  lavfi: remove disabled FF_API_FILTERS_PUBLIC cruft
  lavfi: remove disabled FF_API_DEFAULT_CONFIG_OUTPUT_LINK cruft
  lavfi: use proper FF_API guards for different deprecated functions
  lavfi: remove disabled FF_API_VSRC_BUFFER_ADD_FRAME cruft
  lavfi: remove disabled FF_API_SAMPLERATE64 cruft
  lavfi: remove disabled FF_API_GRAPH_AVCLASS cruft

Conflicts:
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/buffersrc.c
	libavfilter/formats.c
	libavfilter/graphparser.c
	libavfilter/version.h
	libavfilter/video.c
	libavfilter/vsrc_buffer.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-27 00:34:36 +02:00
Anton Khirnov 1961e46c15 lavfi: remove disabled FF_API_FILTERS_PUBLIC cruft 2012-06-26 13:20:19 +02:00
Stefano Sabatini 720ec62012 lavfi: drop deprecated and disabled packing API
It was deprecated and removed after the recent 2->3 major bump.
2012-06-26 11:40:21 +02:00
Michael Niedermayer 1c60088885 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  x86: Only use optimizations with cmov if the CPU supports the instruction
  x86: Add CPU flag for the i686 cmov instruction
  x86: remove unused inline asm macros from dsputil_mmx.h
  x86: move some inline asm macros to the only places they are used
  lavfi: Add the af_channelmap audio channel mapping filter.
  lavfi: add join audio filter.
  lavfi: allow audio filters to request a given number of samples.
  lavfi: support automatically inserting the fifo filter when needed.
  lavfi/audio: eliminate ff_default_filter_samples().

Conflicts:
	Changelog
	libavcodec/x86/h264dsp_mmx.c
	libavfilter/Makefile
	libavfilter/allfilters.c
	libavfilter/avfilter.h
	libavfilter/avfiltergraph.c
	libavfilter/version.h
	libavutil/x86/cpu.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-24 02:09:53 +02:00
Paul B Mahol c9e183b490 lavfi: update some deprecated functions
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-06-16 15:15:16 +00:00
Michael Niedermayer c7b9eab2be Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtmp: Add a new option 'rtmp_buffer', for setting the client buffer time
  rtmp: Set the client buffer time to 3s instead of 0.26s
  rtmp: Handle server bandwidth packets
  rtmp: Display a verbose message when an unknown packet type is received
  lavfi/audio: use av_samples_copy() instead of custom code.
  configure: add all filters hardcoded into avconv to avconv_deps
  avfiltergraph: remove a redundant call to avfilter_get_by_name().
  lavfi: allow building without swscale.
  build: Do not delete tests/vsynth2 directory, which is no longer created.
  lavfi: replace AVFilterContext.input/output_count with nb_inputs/outputs
  lavfi: make AVFilterPad opaque after two major bumps.
  lavfi: add avfilter_pad_get_type() and avfilter_pad_get_name().
  lavfi: make avfilter_get_video_buffer() private on next bump.
  jack: update to new latency range API as the old one has been deprecated
  rtmp: Tokenize the AMF connection parameters manually instead of using strtok_r
  ppc: Rename H.264 optimization template file for consistency.
  lavfi: add channelsplit audio filter.
  golomb: check remaining bits during unary decoding in get_ur_golomb_jpegls()
  sws: fix planar RGB input conversions for 9/10/16 bpp.

Conflicts:
	Changelog
	configure
	doc/APIchanges
	ffmpeg.c
	libavcodec/golomb.h
	libavcodec/v210dec.h
	libavfilter/Makefile
	libavfilter/allfilters.c
	libavfilter/asrc_anullsrc.c
	libavfilter/audio.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/avfiltergraph.c
	libavfilter/buffersrc.c
	libavfilter/formats.c
	libavfilter/version.h
	libavfilter/vf_frei0r.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/video.h
	libavfilter/vsrc_color.c
	libavformat/rtmpproto.c
	libswscale/input.c
	tests/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-13 22:43:57 +02:00
Anton Khirnov 9baeff9506 lavfi: replace AVFilterContext.input/output_count with nb_inputs/outputs
This is more consistent with naming in the rest of Libav.
2012-06-13 11:13:22 +02:00