[FFmpeg-cvslog] swscale/yuv2rgb: make sure yuvTable is set to NULL after deallocation

Michael Niedermayer git at videolan.org
Mon Sep 16 23:03:41 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Sep 16 22:47:21 2013 +0200| [46a723ec7254e6c99958db84be1e490582981032] | committer: Michael Niedermayer

swscale/yuv2rgb: make sure yuvTable is set to NULL after deallocation

ensures no stale pointers remain

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libswscale/yuv2rgb.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index 3a80eca..c0263cd 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -773,7 +773,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
     cgu = ((cgu << 16) + 0x8000) / cy;
     cgv = ((cgv << 16) + 0x8000) / cy;
 
-    av_free(c->yuvTable);
+    av_freep(&c->yuvTable);
 
     switch (bpp) {
     case 1:
@@ -912,7 +912,6 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
         fill_gv_table(c->table_gV, 4, cgv);
         break;
     default:
-        c->yuvTable = NULL;
         if(!isPlanar(c->dstFormat) || bpp <= 24)
             av_log(c, AV_LOG_ERROR, "%ibpp not supported by yuv2rgb\n", bpp);
         return -1;



More information about the ffmpeg-cvslog mailing list