aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-18 12:46:54 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-18 12:47:22 +0200
commitdd2eaf57b76033bf5e8d49457088dec60ad3e9a4 (patch)
tree7ab47b47d9c65e4dcf997f17c68027748e89a07d
parent71b7427e9bdda62d5f4cb042c608ad99b1bf28b9 (diff)
parent1dd35611433c224e2231ed7ae26b5b560863a3cb (diff)
downloadffmpeg-dd2eaf57b76033bf5e8d49457088dec60ad3e9a4.tar.gz
Merge commit '1dd35611433c224e2231ed7ae26b5b560863a3cb'
* commit '1dd35611433c224e2231ed7ae26b5b560863a3cb': vf_format: do not use the AVFilterFormats internals. Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/vf_format.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c
index 0408a277ca..c14e12704d 100644
--- a/libavfilter/vf_format.c
+++ b/libavfilter/vf_format.c
@@ -81,15 +81,17 @@ static av_cold int init(AVFilterContext *ctx)
static AVFilterFormats *make_format_list(FormatContext *s, int flag)
{
- AVFilterFormats *formats;
+ AVFilterFormats *formats = NULL;
enum AVPixelFormat pix_fmt;
- formats = av_mallocz(sizeof(AVFilterFormats));
- formats->formats = av_malloc(sizeof(enum AVPixelFormat) * AV_PIX_FMT_NB);
-
for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
- if (s->listed_pix_fmt_flags[pix_fmt] == flag)
- formats->formats[formats->nb_formats++] = pix_fmt;
+ if (s->listed_pix_fmt_flags[pix_fmt] == flag) {
+ int ret = ff_add_format(&formats, pix_fmt);
+ if (ret < 0) {
+ ff_formats_unref(&formats);
+ return NULL;
+ }
+ }
return formats;
}