[FFmpeg-devel] [PATCH 39/39] avcodec/avcodec: Don't free options on failure in avcodec_open2()

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri May 21 12:17:42 EEST 2021


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 at outlook.com>
---
 libavcodec/avcodec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index a65109e799..d369b30bbc 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -372,7 +372,6 @@ end:
     return ret;
 free_and_end:
     avcodec_close(avctx);
-    av_dict_free(options);
     goto end;
 }
 
-- 
2.27.0



More information about the ffmpeg-devel mailing list