input: fix check for unnamed attachment, potential read overflow
input: fix check for unnamed attachment, potential read overflow

Pointed-out-by: <763da108cb1e7cb856485c7bf11ce0fd11340276@mail.ustc.edu.cn>

xkfz007/vlc,shyamalschandra/vlc,shyamalschandra/vlc,xkfz007/vlc,xkfz007/vlc,vlc-mirror/vlc,vlc-mirror/vlc,shyamalschandra/vlc,shyamalschandra/vlc,xkfz007/vlc,vlc-mirror/vlc,vlc-mirror/vlc,vlc-mirror/vlc,shyamalschandra/vlc,vlc-mirror/vlc,shyamalschandra/vlc,vlc-mirror/vlc,shyamalschandra/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc