[FFmpeg-cvslog] libavutil/opt: Small bugfix in example.
Kacper Michajłow
git at videolan.org
Fri Aug 26 15:41:03 EEST 2016
ffmpeg | branch: release/2.8 | Kacper Michajłow <kasper93 at gmail.com> | Sat Jul 23 21:43:06 2016 +0200| [d3ecb24539138ef40c386ba3f4e6b002b9538cf2] | committer: Michael Niedermayer
libavutil/opt: Small bugfix in example.
Fix const corectness and zero init the struct. This example code would actually crash when initializing string.
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 69630f4d304a4e35d90957d6a170744af87cbf93)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3ecb24539138ef40c386ba3f4e6b002b9538cf2
---
libavutil/opt.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 4f2b46e..d8261db 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -58,7 +58,7 @@
* The following example illustrates an AVOptions-enabled struct:
* @code
* typedef struct test_struct {
- * AVClass *class;
+ * const AVClass *class;
* int int_opt;
* char *str_opt;
* uint8_t *bin_opt;
@@ -96,7 +96,7 @@
* @code
* test_struct *alloc_test_struct(void)
* {
- * test_struct *ret = av_malloc(sizeof(*ret));
+ * test_struct *ret = av_mallocz(sizeof(*ret));
* ret->class = &test_class;
* av_opt_set_defaults(ret);
* return ret;
More information about the ffmpeg-cvslog
mailing list