Browse code

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

ensures no stale pointers remain

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

Michael Niedermayer authored on 2013/09/17 05:47:21
Showing 1 changed files
... ...
@@ -773,7 +773,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
773 773
     cgu = ((cgu << 16) + 0x8000) / cy;
774 774
     cgv = ((cgv << 16) + 0x8000) / cy;
775 775
 
776
-    av_free(c->yuvTable);
776
+    av_freep(&c->yuvTable);
777 777
 
778 778
     switch (bpp) {
779 779
     case 1:
... ...
@@ -912,7 +912,6 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
912 912
         fill_gv_table(c->table_gV, 4, cgv);
913 913
         break;
914 914
     default:
915
-        c->yuvTable = NULL;
916 915
         if(!isPlanar(c->dstFormat) || bpp <= 24)
917 916
             av_log(c, AV_LOG_ERROR, "%ibpp not supported by yuv2rgb\n", bpp);
918 917
         return -1;