The LZW patent (that gifs use) has been copyrighted and any program that wishes to provide any kind of gif support must pay a quite large amount of money to the company that owns the patent. Read more details here. (thanks qwerty ).
I'm also reading a number of websites that say "Many legal experts have concluded that the patent does not cover devices that can only uncompress LZW data and cannot compress it." That means that if mIRC only reads the .gif file, it should be safe from legal issues.