[FFmpeg-cvslog] lavu/opt: make av_opt_query_ranges_default() return a meaningful error code
Stefano Sabatini
git at videolan.org
Sat Dec 8 19:55:10 CET 2012
ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sat Dec 8 18:41:06 2012 +0100| [129d73715084620f52dd507aeab29eb8e1da490e] | committer: Stefano Sabatini
lavu/opt: make av_opt_query_ranges_default() return a meaningful error code
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=129d73715084620f52dd507aeab29eb8e1da490e
---
libavutil/opt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 098dba3..b8ad36f 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1228,11 +1228,14 @@ int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const ch
AVOptionRange **range_array = av_mallocz(sizeof(void*));
AVOptionRange *range = av_mallocz(sizeof(*range));
const AVOption *field = av_opt_find(obj, key, NULL, 0, flags);
+ int ret;
*ranges_arg = NULL;
- if (!ranges || !range || !range_array || !field)
+ if (!ranges || !range || !range_array || !field) {
+ ret = AVERROR(ENOMEM);
goto fail;
+ }
ranges->range = range_array;
ranges->range[0] = range;
@@ -1266,6 +1269,7 @@ int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const ch
range->value_max = INT_MAX/8;
break;
default:
+ ret = AVERROR(ENOSYS);
goto fail;
}
@@ -1274,7 +1278,7 @@ int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const ch
fail:
av_free(ranges);
av_free(range);
- return -1;
+ return ret;
}
void av_opt_freep_ranges(AVOptionRanges **rangesp)
More information about the ffmpeg-cvslog
mailing list