avcodec/avcodec: Don't free options on failure in avcodec_open2()

Instead return the dictionary in the state it is at the time the error
occurred. This is more in line with the description of this parameter
and allows to notify the user of unrecognized options if an error
happens lateron (which might very well be due to e.g. misspelled
options).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/362/head
Andreas Rheinhardt 4 years ago
parent d29541c90a
commit 7af1a3cebe
  1. 1
      libavcodec/avcodec.c

@ -372,7 +372,6 @@ end:
return ret;
free_and_end:
avcodec_close(avctx);
av_dict_free(options);
goto end;
}

Loading…
Cancel
Save