lavc: use buf[0] instead of data[0] in checks whether a frame is allocated

data[0] may be NULL for valid frames with hwaccel pixel formats.