Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pngrutil.c: Delete dead code in png_handle_PLTE()
Delete unreachable code in png_handle_PLTE() related to the condition #ifndef PNG_READ_OPT_PLTE_SUPPORTED. Suppose PNG_READ_OPT_PLTE_SUPPORTED is not defined. If png_ptr->color_type is not PNG_COLOR_TYPE_PALETTE, the function has returned earlier in the function. So if we reach here, png_ptr->color_type must be PNG_COLOR_TYPE_PALETTE, therefore the if-else statement: if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { A; } else if (blah) { B; } is equivalent to: A; On the other hand, suppose PNG_READ_OPT_PLTE_SUPPORTED is defined. Then "if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)" and the entire "else if (blah) { B; }" are not compiled, leaving only "A;".
- Loading branch information