[FFmpeg-cvslog] avcodec/hashtable: Only free buffer if there is buffer to free

Andreas Rheinhardt git at videolan.org
Wed Jun 4 16:41:05 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Jun  3 22:50:32 2025 +0200| [a2c3d99478584808f6a09ecd90b9b63b72689443] | committer: Andreas Rheinhardt

avcodec/hashtable: Only free buffer if there is buffer to free

Reviewed-by: Emma Worley <emma at emma.gg>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a2c3d99478584808f6a09ecd90b9b63b72689443
---

 libavcodec/hashtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hashtable.c b/libavcodec/hashtable.c
index 0e9b3d88c2..0d5c816cd7 100644
--- a/libavcodec/hashtable.c
+++ b/libavcodec/hashtable.c
@@ -207,6 +207,6 @@ av_cold void ff_hashtable_freep(FFHashtableContext **ctx)
 {
     if (*ctx) {
         av_freep(&(*ctx)->table);
+        av_freep(ctx);
     }
-    av_freep(ctx);
 }



More information about the ffmpeg-cvslog mailing list