Commit 46a723ec authored by Michael Niedermayer's avatar Michael Niedermayer

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

ensures no stale pointers remain
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9078b40d
...@@ -773,7 +773,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], ...@@ -773,7 +773,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
cgu = ((cgu << 16) + 0x8000) / cy; cgu = ((cgu << 16) + 0x8000) / cy;
cgv = ((cgv << 16) + 0x8000) / cy; cgv = ((cgv << 16) + 0x8000) / cy;
av_free(c->yuvTable); av_freep(&c->yuvTable);
switch (bpp) { switch (bpp) {
case 1: case 1:
...@@ -912,7 +912,6 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], ...@@ -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); fill_gv_table(c->table_gV, 4, cgv);
break; break;
default: default:
c->yuvTable = NULL;
if(!isPlanar(c->dstFormat) || bpp <= 24) if(!isPlanar(c->dstFormat) || bpp <= 24)
av_log(c, AV_LOG_ERROR, "%ibpp not supported by yuv2rgb\n", bpp); av_log(c, AV_LOG_ERROR, "%ibpp not supported by yuv2rgb\n", bpp);
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment