Fix potential buffer overflow in mediadrmserver am: 5231cc164f
am: 15a7d8c051

Change-Id: I6e90efefcc0d22fe8a4e1f64e99d1b9e0aeb57a9