Why does this fireplace work?
According to the Minecraft Wiki on Gamepedia, fire can spread to any air block in a 3 by 3 square, up to one block under the fire, or 4 blocks above it. It can only spread to air blocks and only if they are next to a flammable block.
Using this information you can easily check if your fireplace is safe by using this command (if you don't have cheats, then you can rebuild it in a world where you do):
/fill ~-1 ~-1 ~-1 ~1 ~4 ~1 minecraft:glass replace air
It will turn any block that the fire can spread to into glass. If there are any flammable blocks that touch the glass produced by this command, then your fireplace is not safe. In your fireplace it looks like this:
There are no flammable blocks next to any glass blocks, so your fireplace should be safe.
Fire can only spread to air blocks that are adjacent to flammable blocks. A block can burn out only if there was fire next to it. From the screenshot it seems you have flammable blocks in range but you do not have air block next to them in range of the fire, that is why the fireplace is safe. You can check out this question as well for more details on fire spread: Minimum safe spacing between lava and flamable materials?