This needs a little clarification.
1.) You presumably purchase the brand name product for use as an ingredient, so there should be no liability even if it is patented.
2. You are legal in advertising that the product contains brand X, if you also note on the same advertisement that brand X is a trademark of X company rather than you..
So, for example, you as XYZ Company, sell TEX SPECIAL (your brand name, hypothetically) ice cream containing OREO brand cookies (crushed) or M&M candies and you buy the OREOs from an authorized seller of Nabisco products and the M&Ms;from an authorized seller of M&M Mars. You can, like McDonalds or Dairy Queen do, advertise your ice cream product as containing OREOs or M&Ms;, because that is, after all, quite true. To be sure you are in the right, however, you should add a disclaimer to the effect that "OREO is a trademark of Nabisco. M&M is a trademark of M&M Mars. TEX SPECIAL is a brand name of XYZ Company. XYZ Company is neither affiliated with, authorized by, or associated in any way with Mars or Nabisco." If you do that, which is what lots of sellers do, you are legal since you are not claiming any association with Nabisco or M&M Mars and you are not being misdescriptive of your product and you are not making a false designation of source.