avutil/opt: Avoid av_uninit

GCC 9-13 do not emit warnings for this at all optimization
levels even when -Wmaybe-uninitialized is not disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
release/7.1
Andreas Rheinhardt 10 months ago
parent dc7a60529c
commit ba7980d9c0
  1. 2
      libavutil/opt.c

@ -1861,7 +1861,6 @@ int av_opt_set_from_string(void *ctx, const char *opts,
{ {
int ret, count = 0; int ret, count = 0;
const char *dummy_shorthand = NULL; const char *dummy_shorthand = NULL;
char *av_uninit(parsed_key), *av_uninit(value);
const char *key; const char *key;
if (!opts) if (!opts)
@ -1870,6 +1869,7 @@ int av_opt_set_from_string(void *ctx, const char *opts,
shorthand = &dummy_shorthand; shorthand = &dummy_shorthand;
while (*opts) { while (*opts) {
char *parsed_key, *value;
ret = av_opt_get_key_value(&opts, key_val_sep, pairs_sep, ret = av_opt_get_key_value(&opts, key_val_sep, pairs_sep,
*shorthand ? AV_OPT_FLAG_IMPLICIT_KEY : 0, *shorthand ? AV_OPT_FLAG_IMPLICIT_KEY : 0,
&parsed_key, &value); &parsed_key, &value);

Loading…
Cancel
Save