[MPlayer-cvslog] r38474 - trunk/gui/util/bitmap.c

ib subversion at mplayerhq.hu
Fri Apr 26 12:34:07 EEST 2024


Author: ib
Date: Fri Apr 26 12:34:06 2024
New Revision: 38474

Log:
Fix incorrect use of av_free().

Replace av_free() with calls that correspond to the allocations.

Modified:
   trunk/gui/util/bitmap.c

Modified: trunk/gui/util/bitmap.c
==============================================================================
--- trunk/gui/util/bitmap.c	Mon Apr 22 23:35:49 2024	(r38473)
+++ trunk/gui/util/bitmap.c	Fri Apr 26 12:34:06 2024	(r38474)
@@ -118,15 +118,15 @@ static int pngRead(const char *fname, gu
     frame = av_frame_alloc();
 
     if (!(avctx && frame)) {
-        av_free(frame);
-        av_free(avctx);
+        av_frame_free(&frame);
+        avcodec_free_context(&avctx);
         av_free(data);
         return 6;
     }
 
     if (avcodec_open2(avctx, avcodec_find_decoder(AV_CODEC_ID_PNG), NULL) < 0) {
-        av_free(frame);
-        av_free(avctx);
+        av_frame_free(&frame);
+        avcodec_free_context(&avctx);
         av_free(data);
         return 7;
     }
@@ -188,8 +188,8 @@ static int pngRead(const char *fname, gu
     avcodec_send_packet(avctx, NULL);   // flush the decoder
 
     avcodec_close(avctx);
-    av_free(frame);
-    av_free(avctx);
+    av_frame_free(&frame);
+    avcodec_free_context(&avctx);
     av_free(data);
 
     return !(decode_ok && img->Bpp);


More information about the MPlayer-cvslog mailing list